In my knowledge of history, whenever one country, state, or nation is being annexed or absorbed by another, it's always done so either unwillingly (through conquest and war) or begrudgingly (out of necessity, such as protection from a bigger, different threat). My question is whether there has ever been an example of one country coming to an agreement with another to join into a single state, or with one nation coming over and saying "Hey, do you guys want to be a part of us?" and the receiving nation saying "Sure! Here you go, take our sovereignty!" Has a situation of this sort ever existed before?
Edit: *Title should be "was not forced."
Many kingdoms (to name a few: Scotland and England, Spain and Portugal, Denmark and Norway, Sweden and Finland) did unify peacefully due to one individual inheriting the relevant titles.
Many colonies west of the US were independent or semi-independent and applied for statehood peacefully, although whether they did so out of necessity or fear they would be militarily annexed is arguable. Utah is one example, although they initially wanted to be a much larger state of Deseret.
Many minor German states agreed to recognise Wilhelm I as Emperor in 1871 after Prussia proved itself capable of defending the German states, forming the German Empire.
In the 1940s and 1950s, many princely states were persuaded by the government of India to accede. In the following years they were integrated. However how much the local rulers knew of the plan to integrate their realms and remove them from power eventually is unclear.
In 1990 West Germany and East Germany unified, perhaps the only example of political unification where there was a clear majority desire in the populations of both countries for unification and there was no coercion or force involved.
This precedes the concept of nation-state central to your question, but the Republic of Venice is famous for not only having its neighbors spontaneously given themselves to the republic, but also for having them fervently defend their adherence to it.
Up until the very early 14th century, the Republic of Venice had limited itself to ruling the communities in the eponymous lagoon (the Rialtine Islands, or Venice proper; the islands of Burano, Murano, Torcello, Malamocco and Pelestrina, as well as the community and lagoon of Eraclea immediately to the north separated from Venice by the sandy sediment of the Sile river estuary). With few external threats to the island communities, the Venetian Lagoon communities had become a microcosm of violent internal activity between the eighth and eleventh centuries.
By the thirteenth century, Venice was considered a prime example of stability and wise republican rule, such that when Biaquino Da Camino fled Treviso after failing to usurp the ruling count, his cousin Gherardo III, he fled his castle in the town of Motta, at the confluence of two rivers that drained just north of Eraclea. He appealed to the Republic of Venice for protection and the Republic was happy to oblige and gain an inland river-port; so in 1291 the town of Motta was given the title, Figlia primogenita della Serenissima ("First daughter of the most Serene Republic") and became the Republic's first inland possession (there had been a parenthesis in the tenth century when a Doge was also ruler of Treviso, but that was a personal union and an altogether different story).
However, no usurpation attempt happens in a vacuum, and by 1329 the weak Guecellone Da Camino (Gherardo III's son) was ousted by the people of Treviso who soon found themselves under the yolk of the ruthless and powerful Canagrande della Scala, Lord of Verona. Canagrande's successor, Mastino della Scala, was defeated by a Venetian-Florentine-Milanese coalition in 1339, technically over a trade dispute with Venice, but really to curb the power of Verona. After peace was signed, the city of Padua, over which the Della Scala ruled with the local counts of Carrara as puppets, was handed back to Marsilio di Carrara with the Republic of Venice's nebulous overlordship (Marsilio was actually Mastino's ambassador to the Doge of Venice, but chronicler Lorenzo de Monarcis recalls that at a state dinner, Marsilio dropped a napkin near the Doge. As they both bent down to pick it up, Marsilio whispered, "What would you give me if I delivered Padua to you?" to which the doge answered "The Lordship of the City" and with that, the betrayal was set). The main line of the House of Carrara, on the other hand, had managed to get itself extinct in the last decade, so during the peace proceedings the ruling council of Treviso petitioned to pass under the direct rule of the Republic of Venice before it could be assigned to anyone else. And with that, Venice added Treviso and the surrounding province to her territory; her first large possession on the Italian mainland.
The Carrara, on the other hand, were able to extract themselves from the Venetian sphere of influence relatively easily. So much so on the death of Gian Galeazzo Visconti in 1402 (Duke of Milan and head of the dynasty that replaced the Della Scala as the most powerful family in northern Italy) his widow Valentina Visconti (yes, they were first cousins) proposed Venetian tutelage over a Veronese-Vicentine buffer state which would separate the Lombard heartland from the voracious lang-grabbing of the Carrara of Padua, foreseeing a protracted conflict. The Vicentines, for their part, unenthusiastic about becoming the designated trampling ground for a three-way power struggle between Milan, Venice, and Padua, sent a delegation to Venice and orchestrated the city's adhesion to the Republic. Venice, hastily managing to assemble a pompous ceremony (rendered all the more difficult as Francesco da Carrara was laying siege to the city) welcomed Vicenza's submission. Once the ceremony was over, the Venetian Doge and Senate laid pen to paper to a letter elaborating how aghast they were that Francesco da Carrara would lay siege to one of their cities, and as a consequence they were declaring war on Padua.
By 1405, the Republic of Venice liberated Verona from the Paduan occupiers; the people of Verona rejoiced and before the city could be returned to the Visconti the town's council sent a delegation to Venice proclaiming they too wanted to adhere to the Republic. Traveling in much more security and much greater numbers than the Vicentines (the Carrara had been hounded back to Padua, where they were under siege) an absurdly pompous day-long ceremony then took place, culminating with the Doge's speech paraphrasing the words of the Prophet Isaiah: "The people that walked in darkness have seen a great light."
In 1406, with the Venetian army occupying Padua and the Carrara chased away, it was then the turn of a Paduan delegation to participate in an even greater and more splendid day-long ceremony, tournament, and feast at the end of which the banner of Padua and the key of the city was traded for the Venetian Banner of St. Mark embodied in gold because it appears the Venetians were making a sport over how absurdly elaborate they could make these ceremonies. No peace treaty was even signed between the Doge and Francesco da Carrara.
Why did the cities of the mainland want to join the Republic? What made Venetian rule so much more attractive than independence, or being ruled by the great house of Visconti? The answer is that Venetian rule was a lot like independence. Sure, taxation and the raising of military levies were now in the hands of a Rector appointed by the Venetian Council of Ten on the advice of the Venetian Senate, but before taking office each Rector took an oath to respect local traditions. In Vicenza, his decisions were subject to veto by a committee of eighteen local citizens. In Verona, the Rector was subject to an annually elected fifty-man legislature and twelve-member executive.
Padua, the richest city on the Venetian mainland, paid for half the Rector's salary, however it gained the greatest benefit from Venetian rule; a massive yearly endowment of 4000 ducats was assigned to the University, which was flooded by new students (prior to 1406, young Venetian men traditionally completed their studies in Constantinople). An opulent club house was constructed in Padua's main square at Venetian expense, where Venetians and Paduans could come together.
Indeed, Venetian rule also allowed more efficient resource allocation. For example, in Verona (Venice's largest new possession on the mainland) the Republic paid for free primary schooling, and stipends to professors of higher education for Civil and Canon Law as well as Medicine, who were also exempt from personal taxation; the origins of the modern University of Verona.
The artistic, cultural, and economic growth that Venetian rule brought to the cities of the Terraferma (it. Mainland) cannot be understated. Indeed, during the War of the League of Cambrai when Pope Julius II pulled together the King of France, the Holy Roman Emperor and the King of Aragon for the sole purpose of destroying and humiliating the Republic the Republic of Venice beat them all not so much because of victory on the field of battle but because the Venetian Mainland cannot be ruled by anyone but the Venetians.
Although Treviso, Padua and Vicenza fell to the Austrians, and Bergamo and Brescia fell to the French, the cities proved impossible to hold. First the citizens of Treviso rose up against the invaders chasing them from the city; 700 Venetian infantrymen were sent to man the walls, and the city was retaken. Next, an oxcart "conveniently" broke down on the drawbridge in Padua, allowing twelve Venetian knights commanded by future Doge Andrea Gritti to charge into the city and rile the populace into expelling the invaders. By the time Gritti rounded up enough men to march on Vicenza, he found the city gates open to him, the people also having revolted in favor of the Republic. French tried to siege Padua, but the citizens, invigorated by Venetian reinforcements, did not capitulate. The war effectively ended in 1516, with peace signed in 1517. The geographic result was the Status Quo Ante Bellum.
Texas (1836-1846) and Hawaii (1893-1900) were both independent republics before they petitioned for entry into the United States.