This isn't a lore summary, but I think it does a good job at explaining the themes/emotions the game is trying to convery
A very basic plot summary would be: Aliens invade earth. Humans make androids to try and combat the aliens. The aliens make machines to combat the androids. The human die out and the machines kill their creators, leave the world populated only by robots who are locked in an endless cycle because their programming forces them to keep fighting. Androids keep the humans' death a secret so that their soldiers don't fall into despair. 9S discovers this secret, 2B does, and shit goes down.