Mother Holle is a little like Baba Yaga in that she has a fearsome visage and she may offer help or hindrance, depending on how she feels about you. Unlike Baba Yaga, however, Mother Holle's motivations are much simpler: she really just wants someone to fluff her bed every morning.
This story came to the brothers by way of Wilhelm Grimm's future wife, Dortchen Wild. It is believed that Charles Perrault's The Fairies was a source of inspiration, given that similar punishment/reward systems were used for the kind and unkind girls. Some variants have the queen asking the king that mercy be shown to her stepmother and stepsister, who are then banished instead of executed.