Joanneeley wrote: We have a new iMac, and now everyone's photos for the past 20 years have appeared on my iphone 12 pro.… How do I remove them?
Don't delete them!
The only way I can think of that pictures could silently arrive on your phone is through iCloud. iCloud synchronizes Photos on different devices. If you have iCloud Photos turned on for your iMac, then all the pictures there are copied to Photos at iCloud.com. Then, if you have iCloud turned on at your iPhone, all the pictures from iCloud.com are copied there. If you delete pictures on your phone, then they will be deleted everywhere else that's connected. All Photos on connected devices are kept the same.
In each case of copying, it was "If you have iCloud Photos turned on…" So the solution would be to turn off iCloud Photos on any device you don't want connected. Once the device is disconnected from iCloud, you can delete pictures. I'd start with a few, wait a day, and check with iCloud.com and other devices. I'm always nervous about deleting things.
On an iPhone, you can switch iCloud Photos off at "Settings>Apple ID>iCloud>Photos" by switching off "Sync this iPhone."
On a Mac, go to Photos' Settings>iCloud and uncheck iCloud Photos.
Turning off and deleting local pictures will leave the pictures at iCloud.com.