In cooking, one must understand how ingredients work, and also have in mind the desired final result. Just like many other ingredients, the form spices take (whole, cracked, ground), when they are added to a dish (beginning, middle, end...in stages), how they are treated before and during the addition (toasted, added to oil, sprinkled on at the end), all impacts the final dish. Yes, spices contain volatiles (as do other ingredients), but you will never loose all perception of them. Therefore the considerations are, do you want the spices to meld together and become the foundation of a dish? Then, add early to warm ghee or oil (which will become flavored and carry the taste and aroma). Do you want to be hit in the face with the aroma/flavor of a particular spice or herb when the plate of food is in front of you? Then add it right before serving. Often it's both, so ingredients are added at different times and in different forms. It's all about the impact you are looking for. Maybe think of ingredients like instruments in an orchestra. They can be drowned out by other things...they can be obnoxiously out of balance...or the conductor can help us make sense of the whole as a unified experience, bringing some to the foreground and keeping others in the background at just the right moments.