In Norse mythology, the Viking gods, or Norse gods, are originally two groups of gods. One group is called Aesir and the second group is called Vanir. Vanir were considered wise and skilled in magical arts.They were usually worshiped in connection with prosperity and the harvest from the earth. In contrast Aesir were worshiped in connection with war and victory.
In ancient times Vanir and Aesir waged war on each other. It is not certain what the outcome of the war. In Ynglingssaga, Snorri Sturluson claims that they decided on peace when both sides got bored with the fighting. But according to Voluspa, is seems as though the Aesir lost the war, at least their city wall is broken down and Vanir sweep across their lands.
Anyway they did make peace on the condition of prisoner exchange. Not that they exchanged prisoners that they had each captured, rather some of the Vanir were sent to the Aesir camp and vice versa. Aesir got Njord (Niord) the enriched along with his children, Freyr and Freyja (Freyia). Vanir got Haenir and with him Mimir, who was the wisest of all