The story I heard was that it originated as a rhyme sung by children during the time of the Black Death.
"Ring around the Rosey" referred to the characteristic marks and redness of the skin eruptions that appeared on victims of the Bubonic Plague.
The "pocket full of posies" was linked to the practice of always carrying flowers on one's person (frequently close to the face) as a means to cover the stench of the dead and dying.
"Ashes, Ashes" related to the fact that dead victims were burned rather than buried.
"All fall down" was a rather fatalistic view of where it would all end . . . presumably with everyoine falling down dead.