Recently, the Trump administration expressed interest in purchasing Greenland. How exactly would this work? I would assume voters in both countries would be on board? Who would the payment go to if the Greenland government doesn’t exist after the purchase? Are there any historical examples of this?
Rather than focus on Greenland, it may be helpful to focus on a previous case where the US purchased a significant piece of land from another country. A nice example is the Alaska Purchase. From the linked Wikipedia page:
The Alaska Purchase (Russian: Продажа Аляски, tr. Prodazha Alyaski, Sale of Alaska) was the United States' acquisition of Alaska from the Russian Empire. Alaska was formally transferred to the United States on October 18, 1867, through a treaty ratified by the United States Senate and signed by President Andrew Johnson.
As for the Russian side of the purchase, Wikipedia states:
In November 2018 a documentary ("SRF bi de Lüt") by the Swiss television broadcast the information that the Russian Tsar in 1867 had first proposed the sale of Alaska to the Prince of Liechtenstein, and that only after the prince rejected, Alaska was offered to the United States. German newspaper Welt am Sonntag reported similar facts earlier, in 2015. The information was vividly discussed in Liechtenstein, and media there first portrayed it as a rumor. However, some days afterwards prince Hans-Adam II personally intervened in the discussion by writing a letter to the media in Liechtenstein, in which he assured that the alleged Alaska purchase offer was not a rumor, and that it was repeatedly a topic of discussion within the princely family in the past. Moreover he showed himself optimistic that archive searches might bring about (so far lacking) historical documents proving that the offer was real.
Based on that, it seems that Russia (the selling party) offered Alaska to the United States and the United States agreed to buy it.
In the Greenland example, the situation is different because Denmark has stated Greenland is not for sale. Greenland is an autonomous country of the Kingdom of Denmark, so for a transaction like the Alaska Purchase to happen they would have to agree to the sale.
The question rightfully points out the democratic issues in such a process.
It's worth mentioning that the concept of a territory transaction between two countries is quite out of date under modern standards. This was a common practice in history when land was considered as a commodity, often incidentally considering the inhabitants themselves as a commodity as well. An important aspect of modern international law is the right of a people to self-determination. The concept of a country "owning" a territory (which is the basis for a transfer of ownership) is at odds with this now well established principle.
Nowadays, nobody (well, nobody sane) denies the legitimacy of the massive decolonization process during the XXth century. This shows quite clearly why a country doesn't "own" its territories anymore: otherwise why would a colonial power give up ownership without any compensation? Even if the "owner" agrees on a deal, and even if the inhabitants validate the transaction democratically, the next generation of inhabitants would still be entitled to claim independence... Obviously this defeats the concept of ownership.
The concept of ownership of a inhabited territory implies that inhabitants have no say in who their land belongs to. It is rooted in a vision of the world where territories can be controlled by force, and it's worth noting that the concept of slavery is not so distant from this vision.
The Trump administration seems to assume that money buys everything. As an illustration, Jared Kushner's Middle East peace plan was also based on giving economic incentives to the Palestinians so that they abandon the land they claim. This is a serious misunderstanding of the deep cultural attachment most people have with their land, and how much it's part of their history and their identity.
If both Greenland and Denmark agree to the deal, then the matter would be simple. Simply transfer Greenland to USA, like it happened with the Dansk Vestindien/Virgin Islands.
But even without Denmark's approval, this could happen in 3 steps.
USA would offer Greenland perhaps 150000 USD to each Greenlander, plus yearly subsidies. Half now, half later. This would create support in the population for the deal. However, no treaties would be signed since Greenland is not sovereign.
Then Greenland would declare independence from Denmark, something they are free to do according to Denmark.
After that, Greenland and USA would be free to merge their countries, even without anything but a promise from USA. Greenland would not be able to survive on its own.
Such purchases have happened, if we count purchases of colonies as fitting the description.
The USA bought territory from France (the Louisiana purchase), Russia (Alaska) and Denmark (The US Virgin Islands). These might not count as the purchases of countries as they were all sold by colonial powers who needed the money more than the territory and the colonies didn't have much say in the event. In principle this could happen with Greenland, but it is a sovereign territory with significant autonomy and the world has changed a lot since 1917 (the last time Denmark sold a colony).
The purchase of whole countries is less common if mergers are not considered (Europe has seen many countries effectively merge for a time through dynastic marriages, though not recently.)
But other forms of merger are known. England and Scotland had shared a monarch since 1603 (with a glitch for Cromwell's commonwealth mid century). But the countries remained separate. They were merged in 1706/7 partially because the Scottish government had nearly bankrupt itself in an ill fated colonial adventure in Panama. A major cause of the Acts of Union, which effectively merged the countries, was the need of Scotland to be bailed out by the richer England. If we allow mergers to count, this is, in effect, one country buying another (by mutual consent). Though that consent has been strained in recent years.
But the idea of countries agreeing to sell territory to others is much less popular in a world where democracy and the people's consent counts for something. And the USA has consent problems of its own with territories it has previous acquired but never properly incorporated into the union (Puerto Rico was acquired from Spain in the treaty that ended the Spanish-American war but still doesn't have the rights of a US state despite a population larger than about 20 of the 50 states).
Regarding the historical examples
I would like to point your attention to the fact that even in the 18/19th century these transactions were not normal. They were mostly motivated by the desire to get at least some money before someone else takes the land by force. None of these territories has been sold for exclusively pecuniary reasons.
If you look at the supposed precedents mentioned in the other answers and comments:
Louisiana Purchase: "Napoleon needed peace with the United Kingdom to implement the Treaty of San Ildefonso and take possession of Louisiana. Otherwise, Louisiana would be an easy prey for the UK or even for the United States. But in early 1803, continuing war between France and the UK seemed unavoidable." (from Lousiana Purchase)
Virgin Islands: "Concerned about recent events and Danish recalcitrance, Lansing implied that if Denmark was unwilling to sell, the United States might occupy the islands to prevent their seizure by Germany." (from Purchase of the United States Virgin Islands, 1917)
Manhattan: In this case the question seems to be, if the sellers were even aware of what they were selling (and also if they were entitled to do so). (Was Manhattan Really Bought for $24?)
Acre: This territory wasn't sold - but conquered. Bolivia had lost the Acre War against Brazil and was forced to cede Acre in the Treaty of Petrópolis, even if it was promised a monetary compensation (which was actually paid).
Florida: Spain didn't give up Florida seeing it as a simple monetary transaction either. After the Napoleonic Wars Spanish authority in Florida was practically non-existant. In 1818 Jackson invaded Florida as Spain could not prevent Seminole attacks or the escape of slaves from Georgia. While not at war with Spain, the US army still captured several Spanish forts. One year later Spain signed the Transcontinental Treaty (or Adams-Onís-Treaty; ratified in 1821). A monetary compensation - which wasn't paid, but used to settle claims by US citizens - was part of the treaty, but it was also about the border in Texas. Spain obtained an US recognition of its sovereignty in Texas, while giving up a territory, which it no longer controlled.
Alaska: Financial difficulties in Russia, the desire to keep Alaska out of British hands, and the low profits of trade with Alaskan settlements all contributed to Russia's willingness to sell its possessions in North America. (History_of_Alaska#Alaska_purchase)
If by this
one country purchase a country
you mean as a legal transaction of acquiring an entire territory (not just a part of land) and claim sovereignty, no I don't think that has happened and can happen in the current structure and order of the world.
Maybe in some twist of things (imagine an end-of-the-world scenario where there is threat to our existence), a new world order will legally allow selling of one country to another, then maybe.
In modern history, the accession of Newfoundland to Canada is somewhat (with a big grain of salt) an example of this. Newfoundland, being basically broke, joined Canada, with the federal government assuming responsibility for the debts. Note that Newfoundland had been a dominion (thus reasonably independent) before, but voluntarily (and temporarily) changed itself into UK colony in 1933, because of dire state of its finances. This being modern times, everything was within democratic framework, with a referendum approving joining Canada.
The United States has bought portions of it's territory 3 times in it's history: Louisiana (France, much larger portion of the country than the state... it doubled the U.S. size by land over night), Florida (Spain), and Alaska (Russia). In the case of Alaska and Louisiana, both deals were initiated by the seller, not the buyer. LA Territory financed Napoleon's wars while Alaska was becoming a fiscal burden to Russia (ironically, it's now one of the richest states in the United States).
Florida is weird (as per frickin' usual) but Spain had a problem policing the U.S./Spainish Florida border and Americans were coming in and living there (not to mention that the English had previously controlled it and ceded it back to Spain following the Revolutionary War). Eventually, the American and English Settlers seceded from Spain, and formed the "Republic of West Florida" or as I prefer to refer to it, "Floridamanistan". And with a name like that, one shouldn't be surprised that West Florida was a nation for 90 days and was finally annexed by the U.S. Spain would also lose disputed territory to the United States over where the LA purchase set the borders, some of the territory being taken by states on Florida's border... and it was hard for Spain to properly defend the territory... So they finally sold the whole state just to be rid of the headache of Florida (In a deal that is best described as "A bunch of Andrew Jackson's thugs holding the Spanish Ambassador at gun point and saying "Wanna sell us one Florida?"). Florida entered U.S. control in much the same way that it does everything else: Some combination of money and stupid and general weirdness that the rest of the country just threw their hands up and said, "Why do we have them again?"
Does this mean Trump is going to hold the Danish Ambassador at gunpoint over Greenland? Probably not... but he does like to vacation in Florida so... I mean... I'm not totally convinced yet