iCloud Photos will try to avoid importing a picture from the iMac if it sees that it already has a copy. It's not perfect, but does pretty well. For the ones that go undetected, you get a Duplicate folder to help you weed out the rest.
Also, the iMac's Photos will then import pictures from iCloud that it doesn't already have. iCloud and your iMac will end up with exactly the same pictures, the combination of both sets. Also, any other device you might have connected to iCloud will have the same pictures.
This will be a major influx of data to your iPhone and your iMac. As muguy says, you may end up with as many as 81000 pictures on all our devices. MAKE SURE you have the space on all your devices--your iMac, and your iPhone if you have one. You don't want one of the devices running out of space before the synchronization is complete! Try calculating ahead to avoid congestion. You may need to move your Photos Library to an external drive. If so, pay close attention to this:
Move your Photos library to save space on your Mac - Apple Support
In particular, to avoid damaging the Photos Library, an external drive must be formatted in either APFS format or Mac OS Extended (Journaled) format.
Another option is to choose "Optimize Storage" in the Photos iCloud Settings. This will transfer only smaller images to the iMac or iPhone to save space. But in that case, external backups become problematic.