I do this all the time when alone at home, to the alarm and confusion of the cats. Usually, some word or phrase I’ve just read or heard reminds me of a line in a song… and off I go! (For example, the mention of any of the actors or films named in the opening number of the Rocky Horror Picture Show will trigger that). Sometimes, it’s almost a subliminal thing; I’ll find myself bursting out with a song I haven’t thought of in years and wonder “Where the heck did that come from?” and then trace it back to something I’d read 5 minutes earlier.
When I used to have a car without a working radio, I’d sing for myself while driving.