Perhaps I'm missing some nuance to this question, but the basic answer is that flavors are made up of various chemical components, and it takes time for them to migrate throughout the sauce/stew/curry/etc. Flavor molecules are often rather large, too, which means they tend to move quite slowly when it comes to dissolving or diffusing throughout a liquid/sauce.
Even if your herbs or spices are in small parts, in chunks, or even ground up, it will take time for the various flavor chemicals to dissolve into the rest of the liquid and then intermingle. When those flavor components are wrapped up in a solid piece of something (even a small powdery piece of herb or spice), it can take time for the flavor to migrate out into the liquid; similarly, some flavor components may be absorbed into the solids or various chunks of food, and that happens at various rates.
Eventually, the mixture will attain a rough state of "equilibrium," where the concentrations have evened out and flavor migration slows significantly. For some mixtures, this could happen within a few minutes, and for others it might take hours or days.
There are some more complex phenomena which might have a minor role. For example, there are also times that temperature cycling can change flavor and texture, as in the stews and curry examples which you mention. Such sauces often contain various types of molecules suspended together, from plain liquid to fats (both liquid fats like oil and solid fats from animals) to gelatin (from animals) to starches and other ingredients. When such mixtures solidify, they can cause bits of the components to separate into large globules or sometimes separate into layers. Since different flavor components are more or less soluble in different things (some dissolve well in water, but others are more soluble in fat or other things), these larger globules can sometimes dissolve different flavors or cause them to migrate through the sauce. When they are mixed together again the second day and reheated, the flavor can seem intensified. The texture can also be altered since the way these globules and solid layers melt back into a liquid can be different. They may not mix back together in the same way they were on the first day, which can change the texture and "mouthfeel," and that can change the way flavor is perceived too.
In other cases, particularly in uncooked foods like raw sauces that are just mixed together, there may be natural enzymes present which may cause reactions that break down more complex molecules into simpler components (like simple sugars) which can also enhance flavor. A lot of these enzyme reactions can take many hours to occur at any noticeable rate. With raw sauces there also may be some small amount of fermentation that goes on with microbes present as well.
Anyhow, there are lots of possible things that could be going on in specific cases, but in the most general sense, it just takes time for large flavor molecules to move around and intermingle.