That's because your picture are actually not on your Mac but in iCloud. See Set up and use iCloud Photos - Apple Support
iCloud is a syncing service more than a backup drive or something. This means that everything you do on any device connected to that same Apple ID will be able to see and change the information on iCloud, which will then replicate this to all the other devices connected.
In order to stop this you'll have to toggle off the option in System Preferences > Apple ID > iCloud and uncheck Photos. That'll stop your Mac from syncing that kind of file. It's the same for every option you see under that menu, actually.
This might also be of interest: How to free up storage space on your Mac - Apple Support