From Stargate Wiki
The Lantean-Wraith War, sometimes known simply as the Wraith War, was a galaxy-spanning conflict between the Lantean civilization and the parasitic humanoid hybrid race known as the Wraith. Despite the clear technological superiority of the Lanteans, ultimately the Wraith proved victorious and Lantean civilization across the Pegasus galaxy came to an end.
Between 5 and 10 million years ago, the Lanteans arrived in Pegasus aboard their city-ship Atlantis. Finding the galaxy largely devoid of sentient life, they spread out freely and reached many corners of the galaxy. Their civilization as well as the second-evolution of their form lived in relative peace and prosperity. But this unchecked expansion would prove to be the undoing of the Lantean civilization. (ATL: "Rising")
Lantean life somehow reached an unknown world, inhabited by life-sucking creatures which would later be known as Iratus bugs. Over time, the DNA of the Lanteans and the Iratus creatures mingled, and eventually evolved into the creatures known as the Wraith–inheriting from their insect ancestry the need to feed on the life force of humanoids. (ATL: "Rising", "Thirty-Eight Minutes", "The Siege, Part 2")
Around 10,000 years ago, at the apex of their civilization, the Lanteans discovered the Wraith on their homeworld and hostilities quickly erupted. The Wraith aggressively fought against the Lanteans, seeking more and larger 'stocks' of humans upon which to feed.
The war initially went in favour of the vastly technologically superior Lanteans, but the tide changed very suddenly when the Wraith were able to capture an immensely powerful energy source from a Lantean ship. Using this Zero Point Module, the Wraith were able to accelerate the cloning process and pump out countless thousands of new soldiers. (ATL: "Spoils of War")
The numerical advantage turned the entire tide of war against the Lanteans, and they repeatedly attempted to regain the upper hand through technological advances. At some point, the Lanteans created a sentient race of machines designed specifically to combat the Wraith. But this experiment was deemed a failure, and ordered destroyed. (ATL: "Progeny")
The Lanteans also tried to put a stop to the Wraith war by designing the Attero device, a tool designed to disrupt the primitive hyperdrive systems utilized by their enemies. This, too, was deemed a failed project, when it became known that the device had the unintended side-effect of causing activated Stargates to explode. (ATL: "First Contact", "The Lost Tribe")
Ultimately however, in a single century, all that remained of Lantean civilization was Atlantis itself. After a siege lasting many years, the Lantean council decided to submerge their great city beneath the ocean surface and evacuate the last survivors of their race through the Stargate back to Earth. (ATL: "Rising", "Before I Sleep", "The Siege, Part 1", "The Siege, Part 2")