Which system version is running on your iMac?
Do you have iCloud Photos enabled or even the Shared iCloud Photos Library? If the photos you are trying to sync are in the Shared iCloud Photos Library, you will not be seeing them in Photos for Mac on a Mac with an older system version. Only Photos 8 on macOS 13 or later can show the Shared iCloud Photos Library on a Mac.
Have you checked, if the photos have been uploaded to iCloud at all? You may want to check this in Safari on your iCloud webpage at www.icloud.com . Sign in with your iCloud AppleID and open the Photos.app on this web page, then look for the missing photos. This will tell if the iPhone is not uploading or if the Mac is not downloading from iCloud. If you can see the missing photos in Safari at www.icloud.com, you can download them from there.
If the Mac is not downloading, you amay also want to check the status bar on your Mac. A common reason for not downloading from iCloud is that the MAc is stuck on uploading items that cannot be uploaded. You will see this in the status bar: Check the status of your library in Photos for macOS - Apple Support