The androids were given a fake god (humanity) to fight for so they wouldn't lose the will to live.
Witnessing this from afar, 9S descends into a vengeful madness. He discovers the horrifying truth behind the war: They died out thousands of years ago. NieR.Automata.Game.of.the.YoRHa.Edition-CODEX.p...
The androids' support pods (042 and 153) gain consciousness and refuse to delete the protagonists' data. Through a collective effort of the player and the community, the pods reconstruct 2B, 9S, and A2, giving them a chance to live in a world free from the cycle of war—provided they don't repeat the same mistakes. The androids were given a fake god (humanity)