Heat comes from the sun, but in reality after the sun. Generally speaking, the hottest time of the day (late afternoon) isn't when the sun is brightest (noon). Then people need to sleep, which means they want to be cooler during the evening.
One way to beat the heat is to adjust the workday. Start work at noon. Let people sleep during the cool of morning. But that is a bridge too far for most cultures.