Lantean-Wraith war

"Then one day our people stepped foot upon a dark world where a terrible enemy slept. Never before had we encountered beings with powers that rivaled our own. In our over-confidence, we were unprepared and outnumbered."

- Melia

The Lantean-Wraith war was the century long conflict which would lead to the destruction of the Ancients as a civilization.

Prelude
Around nine hundred years before the war, the Ancients conducted an experiment on a frozen planet that they claimed was to find a way to immunize themselves against the Iratus bug but was more likely an attempt at making themselves immortal if they couldn't Ascend. Taking one hundred males and one hundred females from various human planets around the galaxy, including Athos, the Ancients experimented upon them, turning them into the first Wraith. Eventually, only ninety-nine of the men and nine of women were still alive. Led by Osprey, the Wraith figured out how to use their telepathic powers and escaped through the Stargate to Athos, taking the facility's ZPM with them along with a weapon designed to kill anything with Wraith DNA. The first Wraith were hunted relentlessly by the Ancients who even used their own families to get at them. Eventually, the Wraith grew in number and organized against the Ancients both for survival and revenge for what was done to them.

War
"The Lanteans were powerful but careless."

- Todd For one hundred years, the Lanteans and the Wraith warred with each other. At first, the Wraith were at a severe disadvantage: the crystalline technology of the Lanteans was far superior to the organic technology of the Wraith, and one Lantean warship was able to incur massive damage on several Hive ships at once with their devastating drone weapons while at the same time suffering little to no damage themselves due to their powerful shield technology. The Lanteans, careless and overconfident, began to send their seemingly invincible warships deeper and deeper into Wraith-controlled territory. After a long period of time and with great cost to themselves, the Wraith managed to capture a number of these vessels and obtain the Zero Point Modules powering them. Using these incredible power sources, the Wraith created at least one cloning facility, which they used to rapidly increase their numbers and give them a much needed advantage. The tide of war quickly turned in their favor; it no longer mattered that the Lanteans would win almost every battle: the Wraith kept coming in floods. Now finding themselves in a war of attrition, the Lanteans slowly fell back as the Wraith absorbed Lantean territory into their own, willingly facing the mighty weapons platforms and outposts protecting Lantean-controlled space in their effort to destroy their greatest enemy. Desperate, the Lanteans began to take more drastic measures, turning to their advanced technology to help them regain an advantage. Project Arcturus, an attempt to extract Zero point energy from our own universe, and the Asurans, nanites designed to destroy the Wraith on a cellular level, were two such attempts. They both failed, with disastrous and far reaching consequences. The closest the Lanteans ever came to developing a means of defeating the Wraith was the Attero device, which could destroy Wraith ships in hyperspace, but its devastating and unforeseen side-effects led to it being abandoned. By the time the Attero device was conceived and subsequently shut down, it was obvious even to the Lanteans that they were losing the war.

Near the end of the war, the Ancients built a device called the Dolmen on the planet Halcyon on the very edge of the Pegasus Galaxy. This device disrupted the Wraith telepathic network and caused great pain to nearby Wraith and reduced any on the planet to a animalistic state. A hive ship commanded by the Wraith Scar went to the planet to cull, but were kept from landing troops due to the Dolmen. The hive ship engaged Ancient forces in orbit over the planet, a battle that left both sides crippled. Faring no better than their Wraith counterparts, the Ancient forces retreated, promising to return with reinforcements to destroy the hive ship, but never came back. The hive ship's hyperdrive was left damaged beyond repair from the battle and going insane with starvation and the effects of the Dolmen, the crew entered hibernation and landed the ship on the planet on automatic.

They continued to gradually lose their ground against the Wraith for several years until the Lantean system was all that remained of their domain. In a final attempt at ending the war, the Lanteans sent a delegation to meet with the Wraith and negotiate a truce. The Lantean delegation was protected by some of their most powerful warships, but they were ambushed by the Wraith's massive fleet. Their last chance at peace now gone, it was only inevitable that the Lanteans would eventually face their defeat.

Siege of Atlantis
"For several more years the Lanteans were able to hold off their attackers, relying on the city's shield and superior weaponry, including the weapons satellite system. No matter how many Wraith ships they destroyed, more kept coming. They could win almost every battle but they saw no way to win the war, so they submerged the city and left."

- John Sheppard.

While the Wraith were at first unable to reach Atlantis due to the numerous weapons platforms deployed throughout the star system, they were eventually able to destroy most of them and continue their conquest. Its last line of defense now gone, nothing was left to prevent the Wraith from advancing to Atlantis itself, held off only by the city's powerful shield and its stockpile of drone weapons. Even though the Lanteans were able to destroy the Wraith vessels every time they attacked, the Wraith were relentless and sent more ships to attack time and time again. Hopelessly outnumbered, the city's supply of drones rapidly dwindling, and the shield under continuous bombardment, the Lanteans ultimately decided to sink the city (which would allow the shield to hold for far longer than it ever could on the surface). Atlantis itself was brought to its knees, and the Lanteans had come to realize there was nothing more they could do. The Lantean Council made the decision to abandon the galaxy through the Stargate and return to Earth with the knowledge that their kind would one day return to Atlantis; the Pegasus Galaxy was left at the mercy of the victorious Wraith, who began to feed on the defenseless human population.

Aftermath
With the Lantean exodus through the Stargate, the Wraith now held sway over the entire Pegasus Galaxy and the human populations, whom the Wraith began to feed on voraciously. Any civilizations that were technologically advanced were wiped out by the Wraith to avoid any challenges to their supremacy; exceptions to this strategy were civilizations like the Travelers and the Genii.

The Wraith victory was however relatively short-lived. Not a few years after their original victory, the Wraith came under ferocious attack from what appeared to be the resurgent Lanteans initially but was soon discovered to be the Asurans, a race of nanite-composed robots originally created by the Lanteans during the first war. The Wraith eventually prevailed over the Asurans but at a terrible cost.