Star Trek: The Next Generation introduced iconic villains The Borg, but their reign of terror has continued long after the missions of the Enterprise-D. A species of cyborgs attached to a central hive mind, the Borg hail from the galaxy's Delta Quadrant and aim to assimilate every other species into their fold in search of cybernetic perfection. The villains first appeared in The Next Generation season 2, as the God-like Q decided to test the strength of Picard's Enterprise crew by pitting them against one the galaxy's deadliest threats.
In Star Trek: TNG season 3's "The Best of Both Worlds," the Borg turn their cold, robotic eye towards Earth and hatch a plan that involves turning Picard into one of their own and adding his tactical knowledge of Starfleet to the hive mind. Armed with this information, the Borg run straight through the Federation's defenses and look set to invade Earth with ease until the crew of the Enterprise manage to rescue Picard and use his connection to the Borg to fight back. Unfortunately, cyborgs aren't easily deterred and as the Star Trek franchise has grown and expanded, the Borg have returned to wreak havoc.
After The Next Generation ended in 1994, the crew reassembled on the big screen and in 1996 came Star Trek: First Contact, where the Borg actually succeed in their goal of invading Earth. The film begins with a Borg cube launching another assault on humankind and once again coming up short thanks to Picard's insider knowledge. However, the Borg have a contingency plan and launch a smaller ship into a temporal vortex to travel back in time, prevent first contact between humans and Vulcans and thereby stunt the technological advancement of Earth, leaving them prone to alien attack. To the horror of the Enterprise crew, they return to Earth to find the planet completely assimilated and resolve to follow the Borg through time to correct the course of history. Ultimately, Picard and the gang manage to set things right.
The Borg almost invaded Earth again in the final episode of Star Trek: Voyager. The overarching premise of Voyager finds the titular ship struggling to get back home from the Delta Quadrant and that dream is only finally realized thanks to the use of a Borg conduit. Working alongside a future version of Captain Janeway, the Voyager crew manage to both deal a crippling blow to the Borg and hitch a ride home, but the Borg Queen manages to send a single sphere after them as they head towards Earth. The Borg ship appears in front of Starfleet's welcome party first, but is immune to the Earthling weaponry and the villains would've undoubtedly assimilated Earth once again if Janeway hadn't stowed Voyager within the Borg spacecraft and blown it up from the inside.
Another close call occurs in Star Trek: Enterprise season 2's "Regeneration." Two Borg drones (left over after the time-traveling antics of First Contact) are discovered in the Arctic and assimilate a pair of unwitting scientists. Though these newly-augmented humans don't attempt to invade Earth alone, they do manage to escape capture long enough to send out a signal to their home Quadrant - thus setting up the invasion seen in First Contact.
If non-canon Star Trek: The Next Generation material was to be taken into consideration, there are a whole host of novels, video games and comics that see the Borg attempt to assimilate the planet Earth, with varying degrees of success. It was also heavily speculated that the Control entity seen in Star Trek: Discovery would evolve into the Borg, but this speculation ultimately proved futile.
Due to the enduring popularity of these villains however, it's surely only a matter of time before a Borg cube finds itself in Earth's atmosphere once again. Star Trek: Picard will take us even further into the future, possibly even the 25th century, perhaps revealing what's happened to the Captain's greatest foe in the two decades since.