Encapsulation and visibility
Encapsulation is a foundational feature of OOP in PHP and something you must understand well if you are to successfully grasp OO PHP.
PHP classes "encapsulate data and functionality." The word "encapsulate" simply means "enclose in a capsule." What this means is that the things inside the capsule, in our case the class, are hidden away.
By hiding things away inside our class, we allow ourselves the freedom to change and refactor the internal workings of the class without any fear of issues outside the class – as long as the public methods and properties remain the same. What this means is that the general wisdom is that you should keep as much as possible hidden away and only expose the minimum amount of functionality and data in order to maximize your freedom to refactor.
Here is the official docs page that you should have a thorough read of:
PHP Manual: Visibility