The principle of collective defence is at the heart of the North Atlantic Treaty – NATO's founding treaty – binding together its 30 member countries.
NATO's primary aim when created more than 70 years ago was to form a pact of mutual assistance in response to the threat that the Soviet Union would seek to extend its control of Eastern Europe to other parts of the continent.
Its creation was also designed to stop the revival of nationalist militarism in Europe through a strong North American presence on the continent, and to encourage European political integration.
There were 12 founding members of the alliance: Belgium, Canada, Denmark, France, Iceland, Italy, Luxembourg, the Netherlands, Norway, Portugal, the United Kingdom and the United States.
On 4 April 1949, the foreign ministers from the 12 founding countries signed the North Atlantic Treaty (also known as the Washington Treaty) at the Departmental Auditorium in Washington DC.
Greece and Turkey joined the alliance in 1952, three years after the treaty, enabling NATO to reinforce its southern flank.
This came at a time when there was a fear of communist expansion throughout Europe and other parts of the world, so extending security to southeastern Europe was strategically important.
Not only did NATO membership curb communist influence in Greece but it also relieved Turkey from Soviet pressure for access to key strategic maritime routes.
Germany became a NATO member on 6 May 1955. This was the result of several years of deliberations among Western leaders and Germany, whose population opposed any form of rearmament.
Another country that would then not join the alliance for more than 20 years was Spain, which joined NATO on 30 May 1982 despite public opposition.
Watch: Where is NATO deployed in Europe?
The move further into eastern Europe
The fall of the Berlin Wall and the termination of the Warsaw Pact after the end of the Cold War opened up the possibility of further NATO enlargement.
This led to the Czech Republic, Hungary and Poland being invited to begin talks at the alliance's Madrid Summit in 1997 and on 12 March 1999, they became the first former members of the Warsaw Pact to join NATO.
Bulgaria, Estonia, Latvia, Lithuania, Romania, Slovakia and Slovenia were part of the second wave of post-Cold War invitees, beginning talks at NATO's Prague Summit in 2002.
On 29 March 2004, they officially became members of the alliance, making this the largest wave of enlargement in NATO history.
Albania and Croatia, who had worked with NATO in a wide range of areas, became official members of the alliance on 1 April 2009.
Montenegro became a member of the alliance on 5 June 2017, following its regained independence in 2016 and actively supporting NATO for many years such as support during a NATO-led operation in Afghanistan in 2010.
On 27 March 2020, North Macedonia became NATO's 30th member after co-operating with the alliance in key areas such as democratic, institutional, security sector and defence reforms.
Watch: Sweden and Finland's applications to join NATO to be fast-tracked.
Potential new members
Sweden recently decided to follow Finland and apply for NATO membership in the wake of Russia's invasion of Ukraine, ending more than 200 years of military non-alignment.
Like Finland, it remained neutral throughout the Cold War but formed closer relations with NATO after the Soviet collapse in 1991.
Public opinion in both countries was firmly against joining NATO until Russia's invasion of Ukraine, after which polls indicated a dramatic shift in favour of membership.
The governments in Finland and Sweden responded by swiftly initiating discussions across political parties about NATO membership and reaching out to the US, UK, Germany and other NATO countries for their support.
The Kremlin has repeatedly warned that the move would have destabilising consequences for security in Europe.
NATO Secretary General Jens Stoltenberg has said that Finland and Sweden would be "welcomed with open arms to NATO" if the countries did apply.
Finland's 800-mile border with Russia would more than double the length of the alliance's border with the country.
Russian President Vladimir Putin has said that Moscow "does not have a problem" with Sweden or Finland as they apply for NATO membership, but that "the expansion of military infrastructure on to this territory will, of course, give rise to our reaction in response".