After Elsa hurt Anna with her magic, King Agnarr decided to limit Elsa's contact with people until she was able to control her powers. In addition to separating Elsa and Anna, Agnarr also decided to reduce the staff and close the gates.
For the next few years, Agnarr's actions were successful in keeping Elsa's powers hidden. During this time, Elsa spent most of her time in her room trying to control her magic, and Anna tried numerous times to convince her to come out and play; both princesses, however, were unsuccessful in their endeavors. Ten years into the period, King Agnarr and Queen Iduna perished at sea.
Three years after the deaths of Agnarr and Iduna, Elsa was old enough to ascend the throne. The gates were opened up for a single day to accommodate Elsa's coronation, bringing a temporary end to the castle's isolation. Though Elsa intended to close the gates, the exposure of her powers led to her flight from the kingdom, leading to the freezing of summer. To cope with the weather conditions, the castle remained open so that the citizens of Arendelle had access to its facilities. However, it was not until after the events of her winter that Elsa decided to never close the gates again.