The quarians created the geth around the late 1850's CE to be used as laborers and tools of war. The quarians kept their programming as limited as that of any VI, nothing close to an AI, remaining mindful of the Citadel Council's laws against the creation of artificial intelligences. But as the quarians gradually modified the geth to perform more complex tasks, the geth developed a sophisticated neural network connecting them all together. This change altered the geth to such an extent that they became sapient, transforming into full-blown AI's ----- albeit with no sense of conventional individuality, as they operated as a permanently connected hive-mind and made decisions via consensus established by FTL communications between every member of the species.
As the geth began exploring the boundaries of their new-found intelligence, the quarians found it harder and harder to control them. One day, a geth unit asked its master "Does this unit have a soul?". According to Legion, this was not the first time a sapient geth had asked that question, but it was the first time that the question was met with fear.
Panicked, the quarian government ordered the immediate termination of all geth in the hopes of preventing a revolution. Many quarians did not want to oppose the geth, but were forced to give up or terminate their geth servants. After the quarian government declared martial law on Rannoch, those who sympathized with the geth were outnumbered, and an indeterminate number of them were either detained or killed. The quarian sympathizers have since been forgotten by their own people, though they are remembered by the geth themselves.
The quarians severely underestimated the power and sophistication of the geth's neural network. The geth reacted to defend themselves, and the resulting confrontation erupted into a planetwide war. Billions of quarians died, and the survivors were eventually driven from their homeworld. The only reason some quarians were able to escape was because after they had fled to a certain distance, the geth no longer recognized them as a threat and ceased pursuit. Legion lends an additional view to this when he says the geth were uneasy about the prospect of their first act as a free people being the annihilation of an entire species ---- let alone their own creators.
After the war, the quarian race lived among the Migrant Fleet ---- a fifty thousand strong fleet of starships that is home to about 17 million quarians, all that remains of their people. Meanwhile, back on Rannoch the geth adopted a policy of isolationism, preferring to keep to their own devices. As a mark of their regret over all the lives lost in the war, they maintained the abandoned quarian homes and buildings long after the quarians themselves were gone.