The Korea Peninsula was governed by Korean empire until it was incorporated by Japan after Russo-Japanese War in 1905. After World War II in 1945, it was devided into Soviet- and American-occupied zones.
North refused to participate in UN-supervised election held in the south in 1948, which led to the creation of two seperates governments for two occupation zones.
Korean War of 1950 was created when both north and south koreas claimed sovereignty over the whole Korean Peninsula and it was ended by the Armistice Agreement of 1953 but the peace treaty was never signed. Both states were accepted into UN in 1991.