As it was explained to me, the Legal ID was required in World War II when stations had to ID at the top and bottom of the hour. It seems there was concern about 'enemy' broadcasts Americans might hear on their radios. After the war, the requirement went from twice an hour to the top of the hour or at a natural break in programming closest to the top of the hour. Legal ID is call letters followed by City of License.
There are some additional items that may be inserted such as the ownership name or the dial position. Because of the way FCC rules are written, most all stations follow the "call letters and city of license" rule strictly.
Legal IDs have been aired at different times in recent years. The commercial break before the hour is the typical placement, even if that break is at 40 minutes past the hour. The claim is a commercial break is a natural break in programming but when the DJ speaks under the jingle at the top of the hour, this is within an uninterrupted string of songs.
Legal IDs have been recorded like the car commercial disclaimers and speeded up a bit so the listeners never can understand them. I've heard this on a few stations. This is fine becauuse it indeed 'airs'.
I see the legal ID requirement as no longer needed. I wonder if they even fine stations these days. I worked at one station 3 .5 years that inserted "FM Stereo" between call letters and city of license (not a legal ID by the rules) and nothing ever happened.