The tune of "Hail to the Chief" originated from a march titled "Jefferson and Liberty," which was composed in 1812 by James Sanderson, a British musician living in Philadelphia. The lyrics were later added to the tune in 1829, honoring President Andrew Jackson. Since then, "Hail to the Chief" became the de facto presidential song, often played by military bands, brass ensembles, or other musical groups to announce the arrival or presence of the president.
The song's title refers to the president as the "Chief Magistrate" or the head of the executive branch of the United States government. It is considered a symbol of respect, authority, and recognition for the office of the presidency and is performed as a musical tribute whenever the president makes a formal entrance at official events.