"Yankee Doodle" is an old melody of murky origins with many versions of humorous verses. During the French and Indian War of 1754-1763, the British sang one version to mock colonial Americans — but the Americans took ownership and turned the song into a one of patriotic pride, especially during the Revolutionary War.
The popular version of the first stanza is
Yankee Doodle came to town
Riding on a pony;
He stuck a feather in his cap
And called it macaroni.
Yankee Doodle, keep it up,
Yankee Doodle dandy;
Mind the music and the step,
And with the girls be handy.
So how was the song disparaging? In 1750s England, Yankee was a general term of contempt. Doodle refers to a lowly provincial person, while a Dandy is a meticulously well-dressed man. In the 1700s, macaroni was an English dandy who affected foreign fashions and mannerisms.
So, roughly translated, the song says, "This country bumpkin came along on a pony — not a horse! — and thought that merely sticking a feather in his hat would turn him into a suave sophisticate like a European. What a rube!"
Despite the mocking tone, New England colonists turned the song into their rallying theme song during the Revolutionary War. They sang it proudly in the battles against the British ... and with extra exuberance when Lord Cornwallis surrendered to George Washington at Yorktown in 1781.