Let's just assume that you've realized the error of your powdered-spice ways, and you've gone out and bought relatively conservative quantities of whole spices—some whole cumin and coriander seeds, say; perhaps some whole cloves and whole star anise pods, too. Let's further assume that you have some tool for pulverizing those spices: either a mortar and pestle or a cheap coffee grinder (one that you've dedicated to the sole purpose of crushing spices). You're good to go, right? Just toast those spices, grind them up, and boom, you've maximized your spices' flavor potential?
Well, no. Not quite. While toasting and grinding whole spices is a crucial part of getting the most flavor out of them, another, equally important step comes into play in many recipes: blooming the ground spices in oil.
There are two very good reasons for frying ground spices in oil, one chemical and the other physical. First, heating up the spices in oil releases fat-soluble flavor compounds contained within spices like cumin and coriander. Second, adding spices to cooking oil will distribute their flavor far more efficiently in the finished dish than either adding them to the liquid component or stirring them in at the end.
If you're skeptical, try it for yourself! In two separate pans, fry up equal amounts of chopped onion in equal quantities of oil. Add a set amount of ground spices to one pan, and cook briefly, about 30 seconds, then add water. In the other pan, reverse the order: Add the water first, then the ground spices. Stir both up and taste. You should notice a marked difference in flavor.
This technique's usefulness isn't limited to heavily spiced dishes like chili (although it is pretty vital for chili!). It's also extremely important in some relatively simple dishes, such as cacio e pepe, in which you really want to get the most bang for your flavor buck from the few ingredients involved. And it's a generally handy tip to keep in mind when making any dish that calls for dried spices or herbs: If you're adding ground chili pepper, red pepper flakes, or, say, dried rosemary or thyme, add them to the sautéed aromatics in the pan and let them cook for 30 seconds to fully draw out their fat-soluble flavors.
Even if your recipe doesn't specifically require this approach, you can easily apply it to almost any favorite dish in your repertoire. Have a tried-and-true chili recipe that calls for adding the chili powder and cumin after you add the liquid? Try putting those same spices in the pot before the liquid, and see if it doesn't improve the flavor of the finished dish. Only thing to keep in mind: Ground spices can burn fairly quickly, so keep an eye on them when they hit the oil, and be ready to add some kind of liquid to prevent scorching if necessary.