- "Do you know what it takes to unite ninety clans, half of whom want to massacre the other half for one insult or another? They speak seven different languages in my army. The Thenns hate the Hornfoots, the Hornfoots hate the Ice-river clans, everyone hates the cave people. So, you know how I got moon-worshipers and cannibals and giants to march together in the same army? ... I told them we were all going to die if we don't get south. 'Cause that's the truth."
- ―King-Beyond-the-Wall Mance Rayder
The King-Beyond-the-Wall is a title given to a Free Folk leader or chieftain who manages to unite a significant number of the northern tribes under his command, enough to pose a threat to the Seven Kingdoms south of the Wall.
Uniting the fractious and independently-minded tribes - who often have radically different traditions, customs and laws from one another, speak different languages, and are always after each other's throats - into a single force is extremely difficult if not downright impossible. Uniting all of the wildlings is only possible with a very intelligent leader of impressive military skill and personal charisma. Most of the time, the wildlings are nowhere near united.
The title and position are not hereditary. It is unknown what the specific process for becoming the current King-Beyond-the-Wall is, though it seems to be based more on general acclamation by the King's followers than on a formal vote.
Recently, the Free Folk had been united under the command of Mance Rayder, the King-Beyond-the-Wall until his death.
According to Jon Snow, "every boy in the North" is taught about the six major attempted wildling invasions south of the Wall over the past one thousand years led by a King-Beyond-the-Wall; all six were defeated.  It is unclear if there were other Kings-Beyond-the-Wall who did not invade in the past millennium. There have been many other Kings-Beyond-the-Wall in the seven thousand years before that, stretching back to the construction of the Wall about eight thousand years ago.
When Osha, Stiv and Wallen - deserters from Rayder's army - inadvertently imprison Bran Stark, they debate taking him back to Mance Rayder to win forgiveness. They reject the notion, which is rendered moot when Robb Stark and Theon Greyjoy arrive. Osha later tells Maester Luwin that they were fleeing the awakening of an old, remorseless foe, the White Walkers, indicating that the wildlings are already aware of the threat of the Walkers and may already be fighting them.
Mormont sends a letter to King's Landing, requesting additional men to help hold the Wall against the threat of the wildlings while he moves against Mance Rayder. Varys suggests that the wildlings may indeed be more dangerous than in the past, due to their uniting under Mance Rayder. However, both Petyr Baelish and Cersei Lannister are dismissive of the threat, pointing out they cannot spare men from their own war against the Starks. Tyrion, recalling his brief time at the Wall, is less certain that the problem can be ignored.
According to Ygritte, thousands of Wildlings are gathering in the Frostfang mountains under the command of King-Beyond-the-Wall Mance Rayder, forming the biggest Wildling host in living memory. Ygritte points out to Jon Snow that the Free Folk follow Mance Rayder because they chose him to be King-Beyond-the-Wall, not like people south of the Wall who serve kings and lords because they are the son of the last ruler. She also says that Rayder used to be a member of the Night's Watch, but fled because he wished to be free, just like the other wildlings.
In the books
In the A Song of Ice and Fire novels, Mance Rayder is a former member of the Night's Watch who turned his cloak and fled beyond the Wall many years before the beginning of the series. As an outsider, his uniting of the wildling tribes is even more impressive (though technically, Rayder was born a wildling, but given up as an infant to be raised by the Night's Watch).
Previous Kings-Beyond-the-Wall included Joramun, Gendel, the Horned Lord, Bael the Bard, and Raymun Redbeard. These are only the most famous and successful Kings-Beyond-the Wall, however: given that the Wall has stood for 8,000 years (according to legend) there were assuredly several others in those many millennia, though they apparently met with less success and therefore are not as well-remembered. This also doesn't include the many frequent, though much smaller, raids around or over the Wall by individual wildling tribes. In Season 3 episode 7 "The Bear and the Maiden Fair (episode)", Jon Snow tells Ygritte that six times in the past one thousand years the Seven Kingdoms have been attacked by a King-Beyond-the-Wall who united all of the wildling tribes, and six times they were defeated. This information is not from the books, however, George R.R. Martin himself wrote the script for that episode.
Joramun was one of the earliest, if not the first, Kings-Beyond-the-Wall, given that the Night's King is said to have been the 13th Lord Commander of the Night's Watch (in contrast with Jeor Mormont, who was the 997th Lord Commander). Joramun must therefore have lived relatively soon after the Wall was constructed eight thousand years ago. According to legend Joramun awoke giants from the earth using a magical horn and made common cause with the King of the North to destroy the Night's King, a formidable and evil sorcerer who had taken over the Night's Watch in its infancy.
Gendel was actually joint king with his brother Gorne. They lived three thousand years ago (after the Andal Invasion of the south, which was six thousand years ago). The brothers and their army bypassed the Wall by digging an extensive tunnel network underneath it. Eventually their invasion was stopped by the Stark King in the North, and Gendel slain. Gorne retreated back to the tunnels with his surviving followers, never to be seen again. It is suspected that they didn't know the tunnels as well as Gendel did, or that there was a cave in. The Night's Watch destroyed the entrances on the southern side but never explored all of the tunnels. Legend holds that the descendants of Gorne's followers live in the tunnels to this day, having degenerated into feral cave-dwellers.
The Horned Lord lived anywhere between one or two thousand years ago (accounts of the exact date are hazy).
After Gendel and Gorne came the Horned Lord, whose name is lost to history, and who allegedly used sorcery to pass the Wall. His invasion occurred either one or two thousand years after Gendel and Gorne, the historical record is unclear (though either way, it was in the hazy period over one thousand years before the Targaryen Conquest, which is the period when the Seven Kingdoms as they were later known truly started to coagulate from smaller kingdoms).
The other five Kings-Beyond-the-Wall that Jon Snow mentioned in "The Bear and the Maiden Fair" must have lived between Gendel and Raymun Redbeard, and attacked between ~700 BC and 184 AC. Jon may have been including the Horned Lord in this count, if he considered that the Horned Lord lived one thousand years ago (some accounts say it was closer to two thousand, in which case Jon wasn't referring to him).
The historical record is particularly murky regarding Bael the Bard. According to legend he lived centuries after Gendel and Gorne, but there are some who deny that he ever actually lived, though the invasion he is associated with is known to have occurred. As the legend goes, Bael infiltrated Winterfell itself disguised as a minstrel, and even seduced the daughter of the current Stark lord and impregnated her. Years later, Bael's son became the new lord of Winterfell, and led his army north to repulse the wildling invasion led by Bael. Ultimately Bael was killed by his own son, and when his mother heard the news she killed herself, because she still loved him. Given that Brandon Stark is referred to as a "Lord" and not "King" in the tale, this may indicate that the invasion took place after the Targaryen Conquest. Mance Rayder, when infiltrating Winterfell in attempt to save "Arya Stark" from the Boltons, used the alias "Abel the Bard" - perhaps an anagram of Bael.
Raymun Redbeard as the last major King-Beyond-the-Wall, who invaded the North about 115 years ago. He was stopped in the year 184 AC at the Battle of Long Lake by Lord Willam Stark (at the cost of his life) and the Umbers. Raymun's invasion occurred the same year that King Aegon the Unworthy died, whose incompetent reign for the past twelve years had left the Seven Kingdoms particularly weakened.
Relatives of a King-Beyond-the-Wall are not considered as royalty among the wildlings. Mance's baby son and his sister-in-law Val (both omitted from the show) are referred to as "wildling prince" and "wildling princess" by Stannis, Selyse and their subordinates, but these titles mean absolutely nothing to other wildlings. Jon, who has learned a lot about the wildlings' customs and traditions while traveling with them, explains to them countless times that "the babe is no more a prince than Val is a princess. You do not become King-Beyond-the-Wall because your father was", but his words fall on deaf ears.
- Gendel and Gorne
- Horned Lord
- Bael the Bard
- Raymun Redbeard
- Mance Rayder