The first suggestion in the Wikipedia article, is that the song refers to Bonnie Prince Charlie, but then the Wikipedia article follows more-or-less along the lines of this thread.
I looked at the Opies' Oxford Dictionary of Nursery Rhymes, but it said nothing.
-Joe-