I do not often see this at new construction, but in homes that are just a few years old it seems that a previous homeowner, somewhere along the way, could not restrain the urge to do some wiring.
This often leads to improperly terminated wires, sometimes energized and sometimes not, and they might be found in the attic, the crawl space the garage, outside. Trying to predict locations in advance is difficult because these do-it-yourselfers might leave the wire just about anywhere. The fact is that electric wires and splices should be properly terminated and that includes putting connections in a covered junction box or, if the circuit is abandoned, then the cable may be removed. Part of the goal is to eliminate confusion as to what is live, what is not live and what might become live if some unmarked switch in the hinterlands is flipped by an unsuspecting party.
Thanks for stopping by,
Steven L. Smith