True that browsing uses more RAM, but nowadays a different approach towards RAM is plausible. In the old days, too little RAM would make a system instantly extremely sluggish, because of the dependance on classical rotating hard disk drives.
With high speed storage, the speed gap between regular storage and RAM storage becomes much smaller and therefor less relevant. This is also one of the reasons why Macs can easily be fitted with "only" 8GB. Add the efficient use of hardware by the OS (since hardware and software are jointly developed by Apple), and there's a lot to say that 8GB will work more than sufficient for home use and light office use.
I use a Macbook Air M1 myself with 8GB and it works like a charm with al lot of programs "opened". And an iMac should be faster than my Macbook, as my Macbook's CPU throttles down the CPU more often to keep the temperature low, because, in contrast to the iMac, my Macbook has passive cooling.