The United Nations was founded in 1945 after World War II to replace the League of Nations, which had failed to prevent the war. The League of Nations was established after World War I but lacked effective enforcement mechanisms and US membership, making the UN a more robust successor with broader international participation.