User blog comment:James12708/Yahg in multiplayer?/@comment-4967682-20120506215130/@comment-1257357-20120512072706

Uhh, F.T.S., did you actually pay attention during those conversations? Legion was leaking the weapons test results the Quarians had been conducting on his people. To defend against them.

As for the fact that the Geth "fought you" in Mass Effect 1, 2 and 3, it is stated multiple times that is due to a difference in belief. Some people from the middle east have committed acts of war, that doesn't mean you'd go to war with every single person there though. Same goes for the Geth. For all their power, the "true" Geth showed their dominence by... Staying in their corner of the galaxy and not bugging anybody.