the longer you stay awake, the more adenosine builds up. the presence of this makes us “feel sleepy”.
there are genes that create 24 hours oscillations in every cell in our body. This is a distributed system that needs to be regulated, or messaged-to. a clock in the brain (suprachiasmatic nucleus in the hypothalamus) syncs these all by way of systemic temperature control (which is lowest around 3am and highest around 3pm). This temperature cycle is what we mean by the circadian rhythm.
In diurnal animals, these two processes overlap at night. In nocturnal animals it is the opposite - they are most alert at night (Nocturnal predators can see while their prey cannot)