I started watching Total Eclipse, which I understand is part of Muv-Luv, but I am unfamiliar with. After episode 2, it seems like the whole tone of the show shifts. Is there some background into what's going on? The first two episodes reminded me a bit of Blue Gender, but after reaching episode 9 it seems like that was totally left behind.
I have not played the visual novels and have not seen any other MuvLuv content, so I can only judge from the anime series. In this series, the two first episodes focus on the background of Yui. You basically witness what she has experienced when she was younger, and then the shift focuses on the 'current day' situation, where Yui is one of the two lead protagonists. Further down the series she reveals some of her background which is consistent with the first two episodes.
The first few episodes are flashback of Yui's past. It basically shown what kind of enemy humanity is facing directly and how front lines of humanity's war look. But rest of the show happens in research&development facility far behind enemy lines with team of people who are not concerned with fighting real enemy. The protagonist is actually concerned that he never fought real enemy and all he ever fought were either other humans or simulations. So the dissonance between those two parts actually makes sense.
If you want to experience the full thing, you should read the VNs: