Apple Photos when used in conjunction with iCloud wants to sync all of the photos you store in iCloud to your Mac. In the event that the storage required is larger than what you have available on your Mac, the Photos application will warn you about low disk space and ask you if you want the OS to optimize your photo library to save space on your Mac. This just keeps lower resolution versions of the original pictures on your local computer. What we refer to as MASTERS (original pictures at their highest resolution) are still stored in the cloud.
For information on this and how to use iCloud Photos please refer to the official Apple documentation linked below.
External Resources
See Related Articles to the right for more information.