Sounds like what you really want is to study computer science. That should be able to explain how it actually works.