European Union law is a system of rules operating within the member states of the European Union. Since the founding of the Coal and Steel Community after World War II, the EU has developed to achieve peace and social justice for its people and in the global community. The EU has political institutions, social and economic policies, which transcend nation-states for the purpose of cooperation and human development. According to its Court of Justice the EU represents "a new legal order of international law". The EU's legal foundations are the Treaty on European Union and the Treaty on the Functioning of the European Union, unanimously agreed by the governments of 28 member states. New members may join, if they agree to play by the rules of the organisation, and old members may leave according to their "own constitutional requirements". People are entitled to participate through the Parliament, and their national governments in shaping the legislation the EU makes. The Commission has the initiative for legislation, the Council of the European Union represents member state governments, the Parliament is elected by European citizens, while the Court of Justice is meant to uphold the rule of law and human rights. As the Court of Justice has said, the EU is "not merely an economic union" but is intended to "ensure social progress and seek the constant improvement of the living and working conditions of their peoples".
Democratic ideals of integration for international and European nations are as old as the modern nation-state. Ancient concepts of European unity were generally undemocratic, and founded on domination, like the Empire of Alexander the Great, the Roman Empire, or the Catholic Church controlled by the Pope in Rome. In the Renaissance, medieval trade flourished in organisations like the Hanseatic League, stretching from English towns like Boston and London, to Frankfurt, and Riga. These traders developed the lex mercatoria, spreading basic norms of good faith and fair dealing through their business. In 1517, the Protestant Reformation triggered a hundred years of crisis and instability. Martin Luther nailed a list of demands to the church door of Wittenberg, King Henry VIII declared a unilateral split from Rome with the Act of Supremacy 1534, and conflicts flared across the Holy Roman Empire until the Peace of Augsburg 1555 guaranteed each principality the right to its chosen religion (cuius regio, eius religio). This unstable settlement unravelled in the Thirty Years' War (1618–1648), killing around a quarter of the population in central Europe. The Treaty of Westphalia 1648, which brought peace according to a system of international law inspired by Hugo Grotius, is generally acknowledged as the beginning of the nation-state system. Even then, the English Civil War broke out and only ended with the Glorious Revolution of 1688, by Parliament inviting William and Mary from Hannover to the throne, and passing the Bill of Rights 1689. In 1693 William Penn, a Quaker from London who founded Pennsylvania in North America, argued that to prevent ongoing wars in Europe a "European dyet, or parliament" was needed. The French diplomat, Charles-Irénée Castel de Saint-Pierre, who worked negotiating the Treaty of Utrecht at the end of the War of Spanish Succession proposed, through "Perpetual Union", "an everlasting peace in Europe", a project taken up by Jean-Jacques Rousseau, and Immanuel Kant after him. After the Napoleonic Wars and the Revolutions of 1848 in the 19th century, Victor Hugo at the International Peace Congress in 1849 envisioned a day when there would be a "United States of America and the United States of Europe face to face, reaching out for each other across the seas".World War One devastated Europe's society and economy, and the Versailles Treaty failed to establish a workable international system in the League of Nations, any European integration, and imposed punishing terms of reparation payments for the losing countries. After another economic collapse and the rise of fascism led to a Second World War, European civil society was determined to create a lasting union to guarantee world peace through economic, social and political integration.