I've always assumed its spontaneous specialization of species: leaving the safety of their nest at those times of day when they are the fittest to occupy a niche.
Once energy conserving "sleep time" exists, the genome can postpone or schedule for activity during these times of day, if it turns out to be more effective somehow.