Bingo, we should see 2B and 9S time / cutscene / dialogue next patch hopefully where 9S will likely do all the info dump, given that is his role. As for 2P, even I'm not very sure but we can only speculate based on available data:
Machine Report 1&2 suggests they are building a private network, and also evolving to incorporate whatever data is within reach, which would be YoRHa units/models. So with this incorporated, they build better models than the old robots to fight back against YoRHa (2B even suggests this herself after the raid when asked).
Saved Machine Lifeform Data 1-4 suggests this could be the original 2P based on the fact that the 2P Compound boss as a reproduce move?
White-Garbed YoRHa Unit's Data Log says that Unit 21O (Operator) was discovered in the bunker; this was used as the setting for the 3rd boss. Possibly that the machine lifeforms obtained this and its memories to then start amassing their own version of YoRHa (white) units
Some lore fanatics speculate that this storyline is based off Ending C, D and/or E from NieR Automata, but that only makes some sense. While it seems like 2B is aware of partially what's going on, something else happened in between of course. Additionally, the bunker was destroyed at the start of Route C in Automata (A and B lead on to Route C), so there was no way for it to remain largely intact upon landing in Eorzea. That is unless somewhere in between the machine lifeforms replicated it, the Copied Factory isn't the only thing they have copied afterall, for there is an area in Automata called Copied City.
2B did say she was damaged in battle against the machine, so 9S arrived first, 2B caught up to us by following explosions. Presumably, the pair were in a battle which brought the bunker down.
One more thing, the pods are more intelligent than this and like all things NieR every character is probably withholding an incredible amount of information. Given the vessel which is a MMORPG that we are on where only a small % of the playerbase is exposed to NieR I'm afraid that whatever reasoning for all this to happen that gets told to us would be significantly dumbed down or cliched.