It is definitely the air flow. I picked it up while running and the noise did not change much.
Which iMac 2017 do you have? If it is the iMac 5K, mine is considerable quieter than my Mac Studio M1 Max. I even confirmed it with a video where I put an iPhone with the Nosh sound level meter app next to the devices. This are the results:
1. iMac 5K (~2 cm from vent): ~28 dB
2. Mac Studio (~10 cm from vent): ~35 dB
3. Every device turned off: ~26.5 dB
4. Mac Studio (~40 cm from vent and on the font): ~29.5 dB
I think the first and second measurements are best to compare the two devices. 7 dB difference is a lot. I wonder if my Mac Studio is somehow defective. But the sound is not whining or scrubbing it is just a constant perceivable air flow.