"And in a sunless realm, the sun rose at last."
- – Master of Mankind (pertains to the war within the Webway but works here too)
The Unification Wars were a series of conflicts focused on Terra and the rest of the Sol System at the end of the Age of Strife, where the Emperor officially revealed himself to the general populace and began knocking heads to unite Terra and its home system. This is arguably one of if not the most pivotal series of events in the whole Warhammer 40,000 setting, as it marks the Emperor's rise to power, the creation of the Primarchs, the creation of the first Space Marines, and the founding of a united Imperium of Man.
Age of Strife
By M23, the human federation that had spread across the galaxy was on the brink of destruction after the war with the Men of Iron. Its infrastructure and economy ravaged by the war and the loss of its entire specialized workforce. Already on it's last legs, Warp storms caused by the birth of Slaanesh separated systems from the larger federation. Cut off from the outside, falling into technological regression and vulnerable to xenos aggression, everything fell apart. This was the nail in the coffin for Terra, which was massively overpopulated and no longer had the resources of it's empire to rely on, as well as the depletion of it's own resources including fucking water.
What followed was about 5,000 years of anarchy, as Terra's once united world government quickly fragmented into dozens upon dozens of warring states. Think Mad Max and the Warring States period of China on an apocalyptic scale, where warlords and their warriors known as techno-barbarians warred against one another and subjugated and brutalized those under their domains. To add salt to the wound, chemical and nuclear wars turned the already overtaxed Terra into a barren, polluted wasteland.
The Emperor of Mankind
It's at this point where the Emperor decided to stop hiding in the shadows and get shit done for Mankind. Appearing as a brilliant strategist, warrior, scientist, leader, diplomat, (and all other professions you could give him)... he made himself known in the 29th millennium, out of nowhere, to challenge the rule of the techno-barbarians and the warlords that ruled the remnants of Terra at this point. Possessing not only plenty of regular human followers that no doubt fought and kept his war industry going (remember, this is prior to the Emperor meeting with the cogheads at Mars) he also lead a massive army of Thunder Warriors. These mighty soldiers were the early prototype for Space Marines, being stronger and nominally bigger than them, basically occupying a spot inbetween Astartes and Custodes, but having very short and unstable lives as well as lacking the innate kinship and coordination which made a Legion so powerful.
With his armies, the Emperor slowly but steadily pushed back all other rivals, conquering them and adding them to his forces. He also had to deal with skirmishes with Martian and Lunar raiders, due to them also wanting to conquer Terra, and to steal some pieces of archeo-tech. His modus operandi was flexible enough to require both subtle diplomacy and propaganda to massive carnage and the slaughter of his enemies. It is during this times that the Emperor shows his hatred and rejection for anything religious (probably because of not being able to control either religion or his raging obsession with control), utterly destroying the Antartic civilization through nuclear warfare because they were a religious society (and shot down the Imperial Emissaries), and also burning the last catheric church when it posed no threat to him. After years of warfare, he conquered the whole planet, while the thunder warriors supposedly died during the last great battle, though probably it was Big E purging them before bringing the newer kids on the block to play. Many talk about the Unification Wars ending after the Battle of Mount Ararat, though really it should end after the Pacification of Luna. Whichever you choose, the result is the same, with the Emperor controlling Terra and gearing towards his Great Crusade to unite Mankind and to find his sons.
40k ain't the only setting with a knack for unifying humanity, so too do giant robots! Called the Reunification war, this war came to be when the Periphery nations of BattleTech refused to bend the knee and kiss the ring to their Inner Sphere betters. When the Star League caught whiff of this there was hell to pay. An invasion by all the Inner Sphere houses into the periphery was underway. A war that would, thanks to periphery nations hating one another as much as the IS, inevitably end in total victory, with each of the periphery states being forcibly entered into the space UN. Luckily for them their loyal servitude wouldn't last long, thanks to one of the periphery nation's leader getting in good with the Star League elite, only to wage his own personal Reunification war when his coup d'état sprung into action.
Where it aaalll started (for BattleTech at least, might've inspired 40k a tad). Smaller in scale than 40k and BattleTech, Macross/Robotech's Unification War all started when an ancient alien ship crashed down to earth in 1999. Worried that the aliens would invade at any time to take back their ship, the UN went about uniting the world under themselves, but some nations had other plans. When the ship struck land in the pacific its technology found itself in the hands of both the UN and Anti-UN forces. This "OverTechnology" could be made into weapons never before seen, and escalated things from simple political bickering to full on combat with the occasional airplane mecha madness thrown in to spice things up. After a long drawn out conflict that saw man kill man, the rebelling nations were eventually pacified. Only for a new enemy to emerge..