There is much to know, and much to learn. There is much material online you can learn from, but it is self-directed and you need to sift through what is most important at every phase of your learning. If you're looking for a dead-tree book on Unity there are several including the one linked to at the bottom of my post. Reviewed books tend to be better if you need guidance of what to learn next; if you don't know what you need to know next it can help get you to the level of basic competency.
As for what goes inside game engines, they are complex beasts. Consider that the major engines have been in development for years and tend to have large teams behind them. They typically represent several hundred work-years of effort by professionals, each person being expert in their own domains. As such, you could not create an engine like Unity or Unreal by yourself if you spent one hundred or five hundred years on it. They contain a huge number of systems: graphics processing, graphics file processing, graphics display, audio playback, audio formats, physics-based an non-physics based simulations, math and numerics libraries, disk libraries, animation libraries, UI libraries, networking support, and much more.