See the following from Set up and use iCloud Photos - Apple Support
Save space on your device
iCloud Photos keeps all your photos and videos in their original, high-resolution version. You can save space on your device when you turn on Optimize Storage.
On your Mac:
- Open the Photos app and click Photos in the menu bar.
- Click Preferences.
- Go to the iCloud tab and choose a storage setting.
If you turn on Optimize Storage, iCloud Photos automatically manages the size of your library on your device. Your original photos and videos are stored in iCloud and space-saving versions are kept on your device. Your library is optimized only when you need space, starting with the photos and videos you access least. You can download the original photos and videos over Wi-Fi or cellular when you need them. You can use Optimize Storage on your iPhone, iPad, iPod touch, and Mac.
If you turn on Download Originals, iCloud Photos keeps your original, full-resolution photos and videos in iCloud and on your device.