Geth War

The Geth War, referred to as the Morning War by the geth, was a conflict between the quarians and the geth that occurred after the latter developed sentience.

Background
The quarians created the geth sometime before 1895 CE to serve as a cheap labor and military force. Since they wanted the geth to be able to perform more complex tasks without supervision, they allowed each geth process to share data using an advanced neural network. As the quarians built more geth, this ability allowed them to become increasingly intelligent, rapidly approaching sentience.

According to Legion during a conversation with Commander Shepard and EDI in Mass Effect 2, in the year 2485 of the quarian calendar, Hala'Dama, a quarian overseer of geth workers, was asked by a geth whether it had a soul and what its purpose was. While not the first quarian to be asked such a question, she was the first to react with fear.

By repeatedly tweaking the geth's systems, the quarians had inadvertently allowed the geth to evolve into an Artificial Intelligence, thus becoming sentient. In response, the quarian government ordered an immediate termination of all geth programs. However, a small number of quarians opposed such rash action, reasoning that it's no crime for the geth to be evolving.

The War
Once the now-sentient geth realized what the quarians were doing, they retaliated. Initially only some geth began to take up arms to protect other units that could not defend themselves. The quarians placed their worlds under martial law, hunting down even those geth not participating in the hostilities, which was opposed by a large portion of the quarian people. They sheltered geth from the authorities, and were detained or killed as a result. Eventually, the opposition became an outnumbered minority. The geth soon overran the quarian homeworld, Rannoch, along with their other colonies and the surviving quarians gathered their ships and fled their planet. They pleaded for help from the Citadel Council, but were denied aid and stripped of their embassy as punishment for creating an AI. The geth emerged victorious, costing the quarians billions of lives and the complete loss of their economy and way of life.

Aftermath
After the remaining quarians fled the planet, they remained on their ships and created a new government and society, known as the Migrant Fleet. The quarians' numbers were devastated: there are approximately only 17 million quarians remaining, and they are still refused an embassy on the Citadel. The geth made no attempt to pursue their former masters, though they could have finished them off as they retreated, out of uncertainty of the ramifications of annihilating an entire species-least of all their own creators. They chose isolation rather then face this uncertainty instead, and remained behind the Perseus Veil, away from the prying eyes of organics. In an attempt to protect the galaxy from the geth, the Citadel sent a fleet to the edge of the Veil. They suspected an imminent attack on all organics by the geth, but no attempt was made by the geth to leave their territory. Afterwards a treaty was established with the Quarians to refrain from attacking the geth, lest they provoke retaliation.

It is also implied by Legion that the geth feel a sort of remorse for killing so many quarians and display this by looking after the quarians' buildings, as though it were a cemetery. At the same time, the sacrifice of those quarians who had opposed the martial law were archived and honored by the geth, even if the quarians themselves had largely forgotten them by then.

Geth-Krieg