It is called a Kingsmoot.
And yes, it is basically a popularity contest. But they haven't done one in quiet a while...
Double Yes, that the show glanced over it... A LOT. There were several captains vying for the Seastone Chair. In the show Euron is also basically combined with his brother Victarion as well,
(Note the Asha in the quotes below is "Yara")
In the name of the Drowned God I summon you. I summon all of you! Leave your halls and hovels, your castles and your keeps, and return to Nagga's hill to make a kingsmoot!"
The Merlyn gaped at him. "A kingsmoot? There has not been a true kingsmoot in..."
"...too long a time!" Aeron cried in anguish. "Yet in the dawn of days the ironborn chose their own kings, raising up the worthiest amongst them. It is time we returned to the Old Way, for only that shall make us great again. It was a kingsmoot that chose Urras Ironfoot for High King, and placed a driftwood crown upon his brows. Sylas Flatnose, Harrag Hoare, the Old Kraken, the kingsmoot raised them all. And from this kingsmoot shall emerge a man to finish the work King Balon has begun and win us back our freedoms. Go not to Pyke, nor to the Ten Towers of Harlaw, but to Old Wyk, I say again. Seek the hill of Nagga and the bones of the Grey King's Hall, for in that holy place when the moon has drowned and come again we shall make ourselves a worthy king, a godly king." He raised his bony hands on high again. "Listen! Listen to the waves! Listen to the god! He is speaking to us, and he says, We shall have no king but from the kingsmoot!"
A roar went up at that, and the drowned men beat their cudgels one against the other. "A kingsmoot!" they shouted. "A kingsmoot, a kingsmoot. No king but from the kingsmoot!" And the clamor that they made was so thunderous that surely the Crow's Eye heard the shouts on Pyke, and the vile Storm God in his cloudy hall. And Aeron Damphair knew he had done well.
A Feast for Crows - The Prophet
And it was called by one their "clergy", Aeron "Damphair" Greyjoy, Balon's brother. Some of those claiming the Seastone Chair don't even believe it;
"I thought you would have heard. Aeron Damphair has called a kingsmoot."
Asha threw back her head and laughed. "The Drowned God must have shoved a pricklefish up Uncle Aeron's arse. A kingsmoot? Is this some jape, or does he mean it truly?"
"The Damphair has not japed since he was drowned. And the other priests have taken up the call. Blind Beron Blacktyde, Tarle the Thrice-Drowned . . . even the Old Grey Gull has left that rock he lives on to preach this kingsmoot all across Harlaw. The captains are gathering on Old Wyk as we speak."
A Feast for Crows - The Kraken's Daughter
Then all those that wish to claim the throne gather and make a speech and show off their plunder to win the hearts of their fellow ironborn. Below is an example of the first one who made a claim, there were others and each time the treasures they offered were greater and greater.
His eyes, Aeron saw, were now grey, now blue, as changeable as the seas. Mad eyes, he thought, fool's eyes. The vision he spoke of was doubtless a snare set by the Storm God to lure the ironborn to destruction. The offerings that his men spilled out before the kingsmoot included sealskins and walrus tusks, arm rings made of whalebone, warhorns banded in bronze. The captains looked and turned away, leaving lesser men to help themselves to the gifts. When the fool was done talking and his champions began to shout his name, only the Farwynds took up the cry, and not even all of them. Soon enough the cries of "Gylbert! Gylbert King!" faded away to silence.
A Feast for Crows - The Drowned Man
Euron promised them basically the world, even claiming he could tame dragons with a horn he found.
"IRONMEN," said Euron Greyjoy, "you have heard my horn. Now hear my words. I am Balon's brother, Quellon's eldest living son. Lord Vickon's blood is in my veins, and the blood of the Old Kraken. Yet I have sailed farther than any of them. Only one living kraken has never known defeat. Only one has never bent his knee. Only one has sailed to Asshai by the Shadow, and seen wonders and terrors beyond imagining . . ."
"If you liked the Shadow so well, go back there," called out pink-cheeked Qarl the Maid, one of Asha's champions.
"I know as much of war as you do, Crow's Eye," Asha said. "Aegon Targaryen conquered Westeros with dragons."
"And so shall we," Euron Greyjoy promised. "That horn you heard I found amongst the smoking ruins that were Valyria, where no man has dared to walk but me. You heard its call, and felt its power. It is a dragon horn, bound with bands of red gold and Valyrian steel graven with enchantments. The dragonlords of old sounded such horns, before the Doom devoured them. With this horn, ironmen, I can bind dragons to my will."
Asha laughed aloud. "A horn to bind goats to your will would be of more use, Crow's Eye. There are no more dragons."
"Again, girl, you are wrong. There are three, and I know where to find them. Surely that is worth a driftwood crown."
"EURON!" shouted Left-Hand Lucas Codd.
A Feast for Crows - The Drowned Man
And in the end Euron laid the best claim and had the most "votes";
"EURON! CROW'S EYE! EURON!" cried the Red Oarsman.
The mutes and mongrels from the Silence threw open Euron's chests and spilled out his gifts before the captains and the kings. Then it was Hotho Harlaw the priest heard, as he filled his hands with gold. Gorold Goodbrother shouted out as well, and Erik Anvil-Breaker. "EURON! EURON! EURON!" The cry swelled, became a roar. "EURON! EURON! CROW'S EYE! EURON KING!" It rolled up Nagga's hill, like the Storm God rattling the clouds. "EURON! EURON! EURON! EURON! EURON! EURON!"
Even a priest may doubt. Even a prophet may know terror. Aeron Damphair reached within himself for his god and discovered only silence. As a thousand voices shouted out his brother's name, all he could hear was the scream of a rusted iron hinge.
A Feast for Crows - The Drowned Man
As always our fine Maesters sum it up in a much shorter version.
Elsewhere in Westeros, petty kings claimed crowns of gold by virtue of their birth and blood, but the driftwood crowns of the ironborn were not so easily won. Here alone in all of Westeros men made their own kings, assembling in great councils called kingsmoots to choose the rock kings and salt kings who would rule over them. Whenever a king died, the priests of the Drowned God would call a kingsmoot to choose his successor. Every man who owned and captained a boat was allowed a voice at these unruly gatherings, which oft went on for days, and in a few instances far longer. The ironborn also tell of occasions when the priests called "the captains and the kings" together to remove an unworthy ruler.
The power wielded by these prophets of the Drowned God over the ironborn should not be underestimated. Only they could summon kingsmoots, and woe to the man, be he lord or king, who dared defy them. The greatest of the priests was the towering prophet Galon Whitestaff, so-called for the tall carved staff he carried everywhere to smite the ungodly. (In some tales his staff was made of weirwood, in others from one of Nagga's bones.)
The World of Ice and Fire - The Iron Islands: Driftwood Crowns
The Iron Islands came under the rule of the Greyjoys when they took it by force and woe to any who opposed them.
Torgon had struck one blow against the institution of the kingsmoot in his youth, by throwing over its chosen king. In his old age he struck another, calling upon his own son Urragon to help him rule. At court and council, in war and peace, the son remained at his father's side for the best part of five years, so when Torgon finally died it seemed only natural for his chosen heir to succeed him as Urragon IV Greyiron. No kingsmoot was summoned, and this time no Galon Whitestaff arose in wroth to protest the succession.
The final, fatal blow against the power of the captains and the kings assembled was dealt when Urragon IV himself died, after a long but undistinguished reign. It had been the dying king's wish that the high kingship pass to his great-nephew Urron Greyiron, salt king of Orkmont, known as Urron Redhand. The priests of the Drowned God were determined not to allow the power of kingmaking to be taken from them for a third time, so word went forth that the captains and kings should assemble on Old Wyk for a kingsmoot.
Hundreds came, amongst them the salt kings and rock kings of the seven major isles, and even the Lonely Light. Yet scarcely had they gathered when Urron Redhand loosed his axemen on them, and Nagga's ribs ran red with blood. Thirteen kings died that day, and half a hundred priests and prophets. It was the end of the kingsmoots, and the Redhand ruled as high king for twenty-two years thereafter, and his descendants after him. The wandering holy men never again made and unmade kings as they once had.
The World of Ice and Fire - The Iron Islands: Driftwood Crowns