How to understand the source code?



I am a third year computer science student. I learned a little simple PHP last semester and I want to make a project with PHP. I read the Matomo’s code and try to understand the code, but I cannot understand how this amazing website and those amazing web tracking features are implemented just using php and javascript.
Could any one help me understand the whole structure of this code? What frameworks should I know? How can I understand the code and maybe devote some pull requests in the future?