The system does its own maintenance during the wee hours.
Actually, since 10.4.5, the OS keeps track of when the last maintenance scripts ran. So you don't need to keep it on 24/7. The next time it starts up, it will notice that at least one of the routines is out of date and run the necessary script.
So this happens "behind the scenes"? I've never experienced an extended boot up time that could be explained by such automated maintenance operations.
"Wee hours"? What are they?

Those are the ones during which you get less done, because they're smaller.