At the conclusion of the Aesir-Vanir War, the Aesir and Vanir gods and goddesses sealed their truce by spitting into a great vat. From their spittle they formed a being whom they named Kvasir (“Fermented Berry Juice”). Kvasir was the wisest human that had ever lived; none were able to present him with a question for which he didn’t have a satisfying answer. He became famous and traveled throughout the world giving counsel.
–from Norse Mythology for Smart People by Daniel McCoy
The way I count them, there were two Aesir-Vanir wars. The first one began when the Aesir tried to kill Freya, a völva from the Vanir clan who traveled to Asgard, using the name Gullveig. Three times they tried to burn her to death. And three times she came back to life.
That first war ended after the two tribes realized they were equally strong, each using their own methods, with an exchange of hostages. The Vanir sent Njord and his twin children, Freyr and Freya, to live with the Aesir, and the Aesir sent Hoenir and Mimir to live with the Vanir.
We know from previous posts that Freyr and Freya assimilated with the Aesir so thoroughly that both are sometimes referred to as Aesir. But Hoenir and Mimir didn’t fare so well among the Vanir.
Impressed by Hoenir’s handsome appearance, the Vanir made him a chieftan and turned to him for advice. Initially they observed that Hoenir was able to dispense excellent advice, but they failed to noticed that he was only able to do so in the presence of Mimir, the creature who guarded the well at the bottom of one of the roots of Yggdrasil which held the source of wisdom in its waters. Hoenir was a good traveling companion, but didn’t stand up to challenges on his own.
When the Vanir noticed that Hoenir’s response to requests for advice were too often that they should let someone else decide, they felt they had been deceived. To respond, they cut off Mimir’s head and sent it to Asgard as a protest.
Fortunately, because Odin had obtained both knowledge of the runes and wisdom through drinking the water from Mimir’s well, he was able to chant magic poems over Mimir’s head and embalm it in herbs so he could continue to ask for Mimir’s counsel.
Thus began the second Aesir-Vanir War, or perhaps only the threat of another war. Since the two tribes of gods already knew the outcome of any continuing battle would likely be the same as before, they decided to conclude or forestall hostilities this time by both Aesir and Vanir spitting into a vat, mixing their spittle. From the mixture a new being arose, Kvasir, an exceedingly wise being to serve as a reminder of their pledge never to take up hostilities again.
For more about Kvasir, see the tale of the Mead of Poetry in Daniel McCoy’s Norse Mythology for Smart People.
 Simek, Rudolf. 1993. Dictionary of Northern Mythology. Translated by Angela Hall. p. 184.