What is fascinating about this country is how it came to be. At the core of the nation are three small cantons up in the mountains that in 1291, much before anyone else in the Holy Roman Empire, defied the domination of the Emperor and proceeded to build the means to enforce their own sovereignty. Since the first agreements were signed in the town of Schwyz, the name “Schweizer Bund” was used to name the entity, from which the modern word “Switzerland” is derived. Those three cantons represent only 3% of modern Switzerland, but the model they proposed attracted more powerful regions, and larger cities like Lucerne, Zurich, Bern, Fribourg and Basel joined the Bund. International recognition was finally achieved at the Peace of Westphalia in 1648. After the Napoleonic Wars, the Congress of Vienna allowed Switzerland to acquire the city of Geneva, giving it its modern borders. Despite being surrounded by larger nations who engaged in brutal wars from 1870 to 1945, Switzerland has remained at peace since 1815.
The details of the assembly of Switzerland over the centuries are quite a bit more complex than this brief article describes. For example, consider the canton of Neuchâtel, where I live. From 1708 through 1857 (except for an interruption between 1807 and 1814 during the Napoleonic wars), Neuchâtel was a principality ruled by the King of Prussia. Notwithstanding being a monarchy ruled by a non-resident king, in 1815 king Frederick William III of Prussia agreed to allow Neuchâtel to join the Swiss Confederation as a full member. At the time, the Confederation was seen as something like the original European Common Market, with a customs, postal, and monetary union but no central supreme government, so this did not change the status of Neuchâtel as a Prussian principality. It was, at the time, the only Swiss canton ruled by a monarch. In the 1848 revolution, Neuchâtel revolted against the Prussian monarchy and established its own republic. The King of Prussia did not take any direct action against the revolution, but refused to recognise the republic or cede sovereignty. This situation persisted, building to the Neuchâtel crisis of 1856–1857, when both Prussia and Switzerland began mobilising for an armed conflict over the status of Neuchâtel. In 1857, a conference involving France, the United Kingdom, Prussia, and Russia was held to avert war and settle the status of Neuchâtel, with the U.K. strongly supporting Neuchâtel independence from Prussia. On 1857-05-26, the King of Prussia ceded his claim and the Republic and Canton of Neuchâtel became a regular self-governing Swiss canton.
So, when did Neuchâtel become part of Switzerland? Was it 1815, 1848, or 1857? Depends on how you define it. And the histories of many of the other cantons are just as complicated.