Many "things" happen in cooking a particular dish. These physical and chemical (even biological) processes require a certain optimal range of temperature (and humidity) and take a certain amount of time to be completed.
For example, when you bake bread, the yeast in the dough remains alive until the temperature rises high enough to kill it. It continues to produce gas as the heat begins to set the dough. The dough should set just as the bubbles are at their largest size for fluffy bread. If gas production peaks before the temperature is high enough, the bubbles can collapse; if the temperature rises too fast, the dough will set too early.
If I have a tough piece of meat, I might cook it for 12 hours at a low temperature and high moisture to tenderize it (and maybe in a braising liquid to add flavor). Then I can cook it for two minutes at a very high temperature to brown the surface without raising the overall temperature, so the inside stays rare. In general when dry-cooking meat you often want the inside to reach a certain temperature, without having the outside dry out too much. So it's a balance between two extremes. If you want an internal temperature of 150 to kill bacteria or parasites, you could imagine cooking for 12 hours until the whole piece reaches that temp, but then you lose a lot of moisture. You could turn it up to 500 and hope the inside heats up faster, but by the time the inside is ready, the meat on the outside gets way too hot and maybe even starts to blacken. Somewhere in between you get the interior done properly, with the exterior just a little browned and crispy.
If you are cooking seeds like rice or beans, it takes a certain amount of time for the seeds to absorb water and become soft enough to eat, and this happens faster if the temperature is high. While cooking in water you have a maximum temperature limit, at the boiling point.
So, cooking instructions are calibrated by trial and error (and educated intuition) to allow the different chemical and physical processes to happen in the conditions that produce best flavor and texture.