Due to the unstable nature of Elsa's powers, until Elsa could learn to control her winter magic, the castle was closed off for 13 years following the late king's orders; this was done for Elsa's safety, as well as the safety of Anna.
On the day of Elsa's coronation, when her magical abilities were unintentionally exposed to the public by Anna, Elsa accidentally sets off an eternal winter upon running away that froze the kingdom. While Anna searched for Elsa who had traveled into the mountains,Hans took on the task of protecting the kingdom.
Towards the end of the film, thanks to Anna's efforts and love for her sister, Elsa found the courage to undo the eternal winter and peace was restored to the kingdom; Hans was sent back to his homeland to face punishment from his twelve older brothers for his actions of treason against the princess and queen and expelling the Duke of Weselton (a.k.a "Weasel-town") from the kingdom.
On the day of Elsa's coronation, when her magical abilities were unintentionally exposed to the public by Anna, Elsa accidentally sets off an eternal winter upon running away that froze the kingdom. While Anna searched for Elsa who had traveled into the mountains,Hans took on the task of protecting the kingdom.
Towards the end of the film, thanks to Anna's efforts and love for her sister, Elsa found the courage to undo the eternal winter and peace was restored to the kingdom; Hans was sent back to his homeland to face punishment from his twelve older brothers for his actions of treason against the princess and queen and expelling the Duke of Weselton (a.k.a "Weasel-town") from the kingdom.