In all versions, the House is used as bait by the witch to attract and capture children like Hansel and Gretel, whom she plans to eat.
Differences between versions
The outside appearnace of the house was pretty similar in all three versions. However, the inside was widely different.
In Babes in the Woods, the outside of the house is the only part made of candy, while the inside is a small and dusty stone room where the Witch lives and stores her captures, with a hatch on the floor leading to an underground cave where she keeps some of the kidnapped children. In Hansel and Gretel however, the inside is way bigger than could actually fit in the inside of the house, with many rooms and corridors, decorated in a style resembling a mansion. For some reason, most of the corridors are decorated with framed pictures of fishbones. Although the inside does not actually seem to be made of candy, when Mickey and Minnie try to flee the house, they encounter many bewitched candy beings hidden throughout the housen. In Once Upon a Time, much like in Hansel and Gretel, the inside of the house is not outright made of candy but is the warehouse of many other treats.