The hidden meanings are almost all invented
Ring a Ring o' Roses is about the plague. HUMPTY Dumpty was a cannon at the siege of Colchester. Mary Mary Quite Contrary is Mary Tudor. Every one of these is a Victorian or twentieth-century guess presented afterwards as fact, and folklorists have found no evidence for any of them.
The plague reading is the easiest to check and the most repeated. The rhyme does not appear in print until the 1880s, more than two centuries after the Great Plague, the early versions have no sneezing and no falling down, and the wording varies wildly between them. People enjoy the idea that a children's rhyme is secretly grim, so the explanations spread faster than the corrections — useful to know before repeating one at a dinner table.
What the rhymes are actually for
A child who can hear that HILL rhymes with JILL, and that HICKORY dickory dock is four beats, is doing the single best-evidenced piece of preparation for reading there is. Hearing a word split into parts comes before mapping those parts onto letters, and it turns out to predict later reading ability better than knowing the alphabet does.
That is why the nonsense does not matter. DIDDLE means nothing, a dish running away with a spoon is not a scene anybody needs to picture, and the point is the shape of the sound. Rhymes also come with actions, a bouncing knee or a clapped beat, and that is a large part of why they stick: the body is helping the memory.
Twinkle Twinkle is a French tune and the words are a poem
The melody is *Ah! vous dirai-je, maman*, a French folk song published in the 1760s. Mozart wrote twelve piano variations on it as a young man, which is often garbled into him having composed it. The same tune also carries the alphabet song and Baa Baa Black Sheep, so three of the first things most English-speaking children learn are the same melody wearing different words.
The words came separately: a poem, *The Star*, published in 1806 by Jane Taylor, who has a real name and a publication date and is almost never credited. Words and tune were only joined together decades later. A great many rhymes work this way — see our classical page for where tunes like this came from.
What the grid holds
HUMPTY on his WALL, JACK and JILL going up the HILL with a PAIL, HICKORY dickory dock with the MOUSE running up the CLOCK, little Miss MUFFET, little BoPEEP who has lost her sheep, MARY and her LAMB, Jack being NIMBLE over the CANDLE, the PUMPKIN eater and rock-a-bye baby in the CRADLE.
Notice how many involve something going wrong. A fall from a wall, a broken crown, a lost flock, a cradle coming down from a treetop. Nobody planned that, but it is probably not an accident either: a rhyme with a small disaster in it is more interesting to say than one without, and interesting is what survives three hundred years of being repeated by people who cannot read.