The role of the United Nations changed significantly. The League of Nations was a rather shoddy attempt, that honestly only had one working goal: war reparations. It failed because it both didn't have the backing of nations interested in aiding it, and because it was a fairly lost cause to begin with.
The United Nations, though, has existed because 1) it serves numerous purposes, and 2) because it established a very important mantle during the Cold War: the open facilitation of conversation on neutral ground. In terms of the first, it has essentially served as a facilitator for numerous activities and goals, from economic aid to facilitation of services from awareness of human rights violations to encouraging collaboration on international projects.
Some examples of this, examples that a lot of people who aren't aware of the United Nations typically don't know about:
World Bank: Offers advice and facilitates aid from developed countries to many developing countries, establishing not only the financial means for them to undergo significant infrastructure development projects, but the finance-driven incentives to make these projects helpful and useful.
WIPO (World Intellectual Property Organization): significant contributions to facilitation of copyright information, particularly in pharmaceuticals and brand names, which heavily encourages companies in westernized nations to make their products available to nations that would otherwise feel free to steal it without repercussions under the rule of national sovereignty.
UN ECOSOC - Essentially serves as a forum for numerous intergovernmental bodies, facilitating discussion and collaboration across multiple groups. The UN general assembly allows governments to communicate; ECOSOC allows organizations to communicate. This has had significant impacts in the formation of bodies such as the Intergovernmental Panel on Climate Change, which houses the single largest body of climate change data and expertise in the entire world.
That isn't to say that the UN is perfect; the Security Council is functionally little more than a means to politely say "do not do this or we will nuke you." The ICC's limited jurisdiction given national sovereignty and very lengthy processes have a very difficult time compensating for the immense manhours and resources devoted to it. But it has so many functions on so many levels that it more than makes up for its failures or weak points, at least in comparison to the League of Nations, which was fairly singularly focused and oriented around European and colonial affairs.