Arandelle is a kingdom depicted as an autocratic Monarchy. The royal family is the government and the law. Just like any other autocratic monarchy, the leadership of the kingdom is going to be passed over to the first child of the reigning king/queen.
The king of Arendelle has 2 wonderful children named Elsa and Anna. Elsa, the older sister, inherited the power of being able to manipulate ice and snow: how it flows, shapes, moves, even creates. However, this power was very hard to be controlled by young Elsa to the point where she started to froze everything she touched and even accidentally froze her sister, Anna,'s heart while playing together. Eventually, Anna was saved by Trolls in the forest by removing her memory about the event and any other memories that include Elsa's power. This gave a huge fright in the King's heart thus leading him to isolate Elsa in her room for years while training her to control her power. This is done because Elsa is the future queen of Arendelle.
Alongside Elsa who was isolated in her room within the castle, Anna was also being kept inside the castle and the castle is closed, Elsa and Anna were not allowed to leave the castle until Elsa's coronation day came.