The selection was made from a shortlist, which was then drawn by lots from a Golden Urn.
According to some of the monks though, the Chinese authorities rigged it so Gyaincain Norbu won. But he was a baby, so why did they select him?
The tl;dr is that it was a calculated move meant to undermine the Dalai Lama's authority. It's been a long time since I've read The Search for the Panchen Lama but I suggest you pick up a copy for a much much fuller picture than what I'm about to give you. (See the booklist)
There is no scripture/law in the Gelukpa sect of Tibetan Buddhism that says that the Dalai Lama is a higher authority than the Panchen Lama, or any other lama for that matter. The theological authority of the Gelukpas is the Ganden Tripa, a position that rotates through high ranking Lamas of the Ganden Monastery. The Dalai and Panchen Lamas draw their authority strictly from tradition and historical sources. I.e. the Dalai Lamas were nothing more than spiritual teachers and tantric/shamanic empowerers until Gushri Khaan conquered Lhasa and the rest of Tibet and (quite literally) gave it all to the Fifth Dalai Lama to rule. Not the Panchen Lama.
But the Panchen Lama and the Dalai Lama have had a long standing relationship. Famously, when the Dalai Lama dies, the Panchen Lama and the Dalai Lama's closest students are the ones who go in search for him. And vice versa. This is one of the main structural deficiencies in the Ganden Phodrang (the old Tibetan Government) because well, it leaves way too many opportunities for power struggles. In the 19th Century, no Dalai Lama made it to adulthood until the 13th (b. 1876) which meant the Panchen Lamas were left to run the country.
This is more or less where the trouble begins, because once the 13th reached majority, he operated under the assumption and belief that he was going to run Tibet. While this seems like a logical standpoint right now, back then it wasn't so cut-and-dry. If you read The High Road to China by Kate Teltscher, it's clear that the Panchen Lama of the late 1700s was clearly the one in charge, and was operating independently for all of Tibet, conducting international relations. And if he had lived longer, it's very possible that Tibet would have ended up with the Panchen Lama on top.
Speculative history aside, land and power disputes are problematic anywhere in the world, and when the Dalai Lama and the Panchen Lama ended up in a land dispute over Tashilhunpo Monastery (the Panchen Lama's seat, ironically constructed by the First Dalai Lama Gedun Drub) the Panchen Lama fled to the Republic of China, allegedly for his safety. The 13th Dalai Lama was in the process of reforming his new independent Tibet, which included modernizing and reforming the army which had already been used in a internal dispute against other Gelukpas, and to many (even today) the 13th Dalai Lama appeared like an aggressive state-builder who wasn't afraid to use force. History seems to bear that out, and for those on the other end of that force, well, it takes on a different tone.
Anyway, the 13th Dalai Lama died, and shortly after the Panchen Lama did, too. The 14th (current) Dalai Lama and the next Panchen Lama were born three years apart (1935 and 1938, respectively) and recognized in a similar time frame. The differences from their past lives still needed to be dealt with, but both seemed to think that they could be overcome (albeit more in line towards their favor, it seems). When the People's Liberation Army invaded in 1950, they immediately split the Dalai Lama's U province from the Panchen Lama's Tsang province in an apparent attempt to split their influence and followers (i.e. making them easier to control if they could play them off of each other). I'm skipping over a lot of complexity, but this is the gist.
When the Dalai Lama fled Tibet in 1959, the Panchen Lama stayed. The Chinese were quick to promote him as the real scion of Geluk Buddhism, not the Dalai Lama (my Chinese-based histories of Tibet are quick to list the Panchen Lamas in the same category of the Dalai Lamas) and Tibet proper. But with the Cultural Revolution and the Hundred Flowers Campaign, things took a turn. The Panchen Lama wrote his 70,000 character petition where he criticised the Beijing government from a socialist stand point, showing how they were not adhering to the principles of socialism and their agreement with the Tibetan people. He wasn't supportive of the Dalai Lama from our current understanding of the "Free Tibet" movement, but he was critical that China's socialist policy was a failure by its own standard (this is at least, my reading of his work).
This immediately put him out of favor with the Beijing government, which arrested him and subjected him to a "struggle session" and a long imprisonment. When he emerged from imprisonment, he dove into a modern lifestyle, married, and fathered a daughter. After he died the struggle for his rebirth took place.
Two things: the Golden Urn and the state of the world upon his rebirth.
The Golden Urn was, shockingly, a jar made of gold that was given by one of the Qing Emperors to the Lhasa establishment for the purpose of drawing lots to choose an incarnate. The Tibetans received the "gift" a bit like a white elephant. They already had their own system (in fact, each lineage has its own traditions and standards for recognition) and didn't need more bells and whistles. But hey, the Emperor gave a gift, so you accept the gift.
As far as I can remember and am aware, the Golden Urn was used twice to locate a Dalai Lama. Once to placate the emperor, and another time to settle a dispute between competing factions over potential candidates. In both times, allegedly, the choice had apparently already been made by the lead monk in charge of locating and confirming the reincarnate candidate.
However, the Urn's significance is that it represents Beijing's authority in the context of Tibet's reincarnated sovereign. Without the Golden Urn, there is no connection between Beijing's authority - however tenuous - and Tibetans selecting their own reincarnate. Especially under the traditional model of the intertwined Dalai-Panchen relationship.
Although, after the Panchen Lama had died (and here's a real short introduction) relations between the Dalai Lama's exile government in Dharamsala and Beijing had thawed a bit. Beijing was trying to entice Taiwan back into the fold, proving that the gifts of socialism were for everyone, and trying to use Tibet as an example. The Dalai Lama's brother and a small delegation were invited to tour Tibet in the hopes that the Dalai Lama and many exiles might return to the Motherland. It'd be a big propaganda victory, but also legitimate proof that it was better to be in socialist paradise than in bougeous exile.
Needless to say, the event was a complete disaster. Beijing had been buying into its own propaganda of the benefits of a socialist Tibet that they failed to actually ask the locals. The Dalai Lama's brother and the delegation were overrun by worshippers who begged for news from the outside world, and complaints over the hellish social experiments they were made to endure at the hands of the PLA. The delegation was quickly rushed to Hong Kong and told to leave and Taiwan quickly said, "Yeah... no thanks" to whatever Beijing was pushing.
This event aside, the Dalai Lama still believed that gradual compromise and mutual benefit between Chinese and Tibetan could be reached. Through a series of back channels, the issue of the Panchen Lama's reincarnate came up and Beijing couldn't be seen to be below the Dalai Lama's authority, but if Beijing and the Dalai Lama cooperated and just happened to come to the same conclusion, that might put both the Tibetans and Dharamsala-Beijing relations on a track for recovery. Skipping over most details, the timing to announce simultaneous findings broke down and the Dalai Lama went ahead and announced that Chokyi Nyima was the reincarnate. The Chinese went and used the Golden Urn (unprecendented in the case of the Panchen lineage) and instead of deciding with the Dalai Lama, it's generally agreed that the Chinese had already decided beforehand to go with Chokyi Gyalpo (referred to by his Sinicized "secular" name Gyaincain Norbu). Originally the plan was to announce their findings at the same time on the same day, but since the Dalai Lama came out first with the "real" candidate, Beijing couldn't bee seen to have their authority usurped, so they announced for Chokyi Gyalpo, arrested Chokyi Nyima and his family, and established Chokyi Gyalpo at Tashilhunpo as the rightful heir.
Sources:
Search for the Panchen Lama by Isabel Hilton
The Fourteen Dalai Lamas by Glenn H. Mullin
The High Road to China by Kate Teltscher
Dragon in the Land of Snows by Tsering Shakya
Tibetan Nation by Warren W. Smith
Highlights of Tibetan History by Wang Furen and Suo Wenqing