public members are accessible from anywhere, protected members only from the class and its subclasses, and private members only from within the declaring class itself. Choosing the narrowest visibility that works enforces encapsulation.
Since PHP 7.4, typed properties can also be declared readonly-adjacent via visibility plus type hints for safer APIs.