This was dealt with by Leonard Bernstein in The Unanswered Question: The Charles Eliot Norton Lectures. Lenny pointed to the overtone series as the primal generator of melody. The overtone series is made of the mathematically derived partial tones overlaying a fundamental note. If your fundamental is C below Middle c, for example, then
the 1st overtone is one octave higher, Middle c.
The 2nd overtone is a fifth higher, g.
The third overtone hits the next octave, c’.
The fourth is a major third up from there, e’.
The fifth is a minor third up from there, g’.
The sixth one sort of falls “in the crack” between a’ and b’-flat.
The seventh is the next octave, c’’.
The “nya-nya” or “Ring Around the Rosie” theme is made of the fourth, fifth, and sixth overtones. The human ear picks these up subliminally within each fundamental tone. They are always there, so it’s natural for children to pick them up before any other sequence of notes. The fourth, fifth, and sixth overtones are close enough together to make a melody with; they are also far down enough to be more audible, since the overtones get fainter and fainter as you go up the series. So these three overtones are the most natural ones for a child’s spontaneous melody.