Korea regained its independence following Japan 's surrender to the United States in 1945 .