According to w3school "Cookies are data, stored in small text files, on your computer."
If that is true how can PHP access cookies, since PHP is execute in the server side?
The browser (Chrome/Firefox etc) of the user will physically look up the cookie on the local computer and send the data to the PHP server.
The PHP server never gets access to the users computer - rather the users computer presents the data requested.
Further reading: This is why cookies are not always great for security as it's up to the users computer to send them, and thus any computer can create their own cookies and send them pretending to be another user if they have access to another users cookies (Via open wifi network snooping etc).