The song was first introduced by Mary Martin and Patricia Neway in the original Broadway production and sung by Julie Andrews in the 1965 film. In the musical, the lyrics to the song are a reference to things Maria loves, such as 'raindrops on roses and whiskers on kittens, bright copper kettles and warm woolen mittens'. These are the things she selects to fill her mind with when times are bad. The original Broadway musical places this song in the Mother Abbess's office, just before she sends Maria to serve Captain von Trapp's family as governess to his seven children. However, Ernest Lehman, the screenwriter for the film adaptation, repositioned this song so that Maria would sing it with the children during the thunderstorm scene in her bedroom, replacing "The Lonely Goatherd", which had originally been sung at this point.
Many stage productions also make this change, shifting "The Lonely Goatherd" to another scene. The first section of the melody has the distinctive property of using only the notes 1, 2, and 5 of the scale. Rodgers then harmonized this same section of the melody differently in different stanzas, using a series of minor triads one time and major triads the next. This song has 16 bars of D minor 7, followed by eight bars of E b minor 7 and another eight of D minor 7. It also has an AABA structure.
The song's main melody seems derivative of Edvard Grieg's In the Hall of the Mountain King, particularly in its repetitive simplicity and its minor key. The happy, optimistic lyrics "Cream colored ponies and crisp apple strudel" are just a counterpoint and cover up an undercurrent of fear. As noted above, the song was written to be sung by a young woman scared of facing new responsibilities outside the convent. In the film script the song is repositioned, with Maria singing it to the von Trapp children during the thunderstorm; but the terror contained in the melody is still the dominant emotion.