Photos creates cache files almost every time you work with it. Here’s an example. If you have iCloud Photo Library enabled, all your pics are stored in the cloud. But when you view these pics on your Mac, Photos creates locally cached copies of them. So, even if you keep all photos in iCloud, their local copies are still wasting space on your Mac.
More cache files pile up when Photos detects faces on your pics — that is, every time you add photos of people. If you import new pics often, you’ve probably got a lot to clean up.