How to learn the back end of flight simulators?
The most advanced open source flight simulator is currently FlightGear. It doesn't fall too far short of its commercial brethren.

The repository is hosted on SourceForge, where you can download the entire codebase.
For documentation and discussion on how it works, see the forum and the mailing lists. 

Once you have questions regarding the codebase per se, especially regarding the technical implementation rather than the business end of the simulation, they are best asked on the forums or on the main Stack Overflow site. Aviation.SE mainly deals with the flying aspects and real-life aircraft.