The classic Star Trek: The Next Generation episode "The Best Of Both Worlds" is often ed for Captain Picard's capture and assimilation into the Borg collective, but the story is really more about Commander Riker. The Borg were introduced a year earlier in the TNG season 2 episode "Q Who," where the Enterprise was thrown into a distant, unexplored region of space by the omnipotent trickster Q. This resulted in the first encounter with the Borg, which was disastrous; if not for a last second intervention by Q, the Borg would have easily destroyed the Enterprise.
Once the Borg became aware of humanity's existence, they began the long journey from their region of space to the Alpha Quadrant, bent on assimilating all life on Earth. The first installment of the two-part "The Best Of Both Worlds" largely deals with the crew of the Enterprise bracing themselves for the Borg's arrival. It also tackles a turning point in the life of Will Riker, the Enterprise's accomplished first officer, who's enduring something of an early midlife crisis.
Riker's Dilemma Mirrors TNG's Head Writer's
After pas a third chance to command his own ship, Riker is gently confronted by Picard about his seemingly stalled career ambitions. Riker eventually becomes alarmed when he realizes he's become happy and comfortable on the Enterprise, and sees a reflection of his younger, more driven self in Lieutenant Commander Shelby, the assertive Borg specialist who happens to be gunning for Riker's job. Riker's dilemma comes to a head when Picard is captured and assimilated by the Borg, forcing Riker to take command of the Enterprise and take on his beloved captain in an effort to save all of humanity.
"The Best Of Both Worlds" was penned by TNG head writer Michael Piller, who was dealing with his own career uncertainty. After TNG's first two seasons were dominated by tumultuous behind-the-scenes chaos, Piller established structure and creative excellence when he came aboard in season 3. Piller had only planned to stay with TNG for one year, but he was enjoying himself greatly and had grown comfortable in his role, much like Riker. Piller would eventually decide to stay at the behest of Star Trek: Voyager.
Why Riker Got Demoted After "The Best Of Both Worlds"
Now captain of the Enterprise, Riker managed the seemingly impossible, rescuing Picard and saving Earth from the Borg threat. The episode ends with Picard back in the captain's chair, and by the following episode Riker has been reduced in rank to commander again, still serving as the Enterprise's first officer. Riker would remain Picard's Number One until the events of Star Trek: Nemesis, the final TNG film, where he was given command of the USS Titan.
The story reasons for Riker's demotion are a bit thin, with Riker simply proclaiming his career prospects are nobody's business but his own. The real world reason is simple - the Enterprise was only going to have one captain, and the producers were in no way interested in losing the popular character of Riker. While he may not have held on to the captain's chair, Riker does have the distinction of being the heart and soul of Star Trek: The Next Generation's best Borg episode.