My question is what really is a game engine and how do you make one?
A game engine is a system for making games—an application, or more commonly a library, providing services such as audio & video output, controller input, timing, physics, and so on. How do you make one? You don’t. If you want to make a game, you should make a game. You will not accomplish that goal, nor really improve as a software developer, by creating middleware without specific goals and requirements in mind.
Just pick an engine (or less—a basic graphics+audio+input library such as SDL is fine) that’s compatible with your style of thinking and/or your preferred programming language. Use it to make something. If you encounter limitations, take the time to understand and work with them. Working under constraints will help you think more creatively. Keep a diary of these situations and maybe next time try a different engine.
You can learn a lot by making an engine—about systems programming, graphics, audio, input, API design, and infrastructure in general—but it’s best to fight on a single front. Want to make a game? Take advantage of the work that others have done. Interested in engine design? Do it as a learning exercise. And anyway, you can learn all of those skills in other ways, incidentally, in the process of creating useful software.