Everything lives in the cloud. Once the photo has been uploaded only the preview is stored on your phone. When you tap on the photo or use the photo/video, the phone pulls the full file down from the cloud.
You can set this in the photos setting. You have the option to store all content locally while also backing up everything in th cloud. However, none of my devices have the space for 357GB of photos so I default everything to “optimize local storage”.