With Apple offering their M1, performance really can be better than a PC/Windows laptop. Though that comes at a price, mostly lots of money for the iMacs in particular, but also almost no options for upgrades. A PC you can keep going for a long time on the same old platform by swapping your CPU, maybe swapping your graphics card, but on an iMac you can't do that. On a PC, you can reuse old power supplies, old cases, old hard drives, old SSDs, old CPU coolers, and old fans, but an iMac is all proprietary and becomes basically useless other than the hard drive/maybe the monitor after 12-15 years.
Neither one is "better". There's different reasons to buy a different thing. If you replace your hardware every 3-5 years anyways, then buying a Mac isn't the worst play.