Wasn't the 21.5 simply as smaller version of the 27" in the prior generation?
No. Well, you
could say that of the higher-end 21.5" models vs. the lower-end 27" models, but the 27" range goes up to i9, 10 core models with powerful GPUs that were never available in 21" form.
The new 24" M1 iMac may displace some of the lower-end 27" models - but it represents le limits of the M1 SoC and people who are running heavy multiprocessing loads, need more RAM, want to connect more than one external display or need the sort of GPU power offered by the high-end options on the Intel iMac will need something better than an M1.
It's quite possible that the 5k replacement will also take in the iMac Pro - the i9 iMac was already challenging it for some workloads, and it is unclear whether Apple are going to engineer some "great divide" between "consumer" and "workstation" chips equivalent to Intel's Core i vs. Xeon distinction (which is being undermined by AMD, anyway...)
In short, the reason the 27" replacement isn't here yet is that it will need "Apple Silicon Pro" (argue amongst yourselves as to whether that will be called M1x or M2).
Bear in mind that, although the M1 iMac beats out some of the 5k iMac models on (carefully selected) benchmarks, it represents a "downgrade" even from the 21.5 in terms of RAM (the 21.5" had a 32GB option, the M1 relies on two on-package LPDDR4 modules which, I think, currently limits it to 24GB even if Apple produce a new option) and number of external displays (the 21.5" could support 2 external 4k displays, the M1 can only support one, even though it can now go up to 6k).
...and while the M1s Thunderbolt connectivity is excellent (better than any of the old iMacs now that each port has its own controller and you will shortly be able to get multiport TB4 hubs) adding any more USB3 ports, SD cards, etc. to a M1 machine would mean leaching off that TB3 bandwidth. An M2 could provide more PCIe/USB and/or Thunderbolt lanes for extra built-in ports.
Do you really need all this RAM? My iMac has 48GB of RAM and has zero swap file in use but it's still slower than my 13" M1 MBP.
...but that's the wrong comparison. The real question is, how would the M1 perform if it had 48GB of RAM? Or, how much would a M2 with 2-3 times as many cores as an M1 have its throughput limited by only having 16GB of RAM to keep those cores fed? It does look like swapping doesn't impact an M1 system as badly as it does on Intel - but RAM is still an order of magnitude faster than SSD so it
will be slowing things down. Plus there's the SSD wear issue, should you be running RAM-heavy workloads day after day.
...because while it is great, and extremely impressive, that the tiny, ultra-low-power M1 can give far larger, power-hungry Intel systems a run for their money, Apple's job with the M2 is
not to make computers "as good as (or a bit better than if you cherry-pick)" the Intel Macs they replace. Rather, the M2 machines should, ideally, thrash 10-core i9s and AMD 5700XTs by the same margin that the M1 hammers the Intel ultra-mobile/iGPU offerings.
Realistically, I think we'll see diminishing returns - since power/performance is ARM's super-power - but I think Apple should be able to produce something that will deliver severe buyer's remorse to anybody who rushed our and bought a M1 machine because it was a bit faster than their 5k iMac.
That said, I don't doubt that a lot of people have bought more RAM than they need, even on Intel. 16GB goes a long way - but if you need more, you need more.
Also, folks, it is 2021 and having 32GB or 64GB of RAM in a $2000+ computer shouldn't be an indulgent luxury that you have to carefully justify because Apple wants $200 to add $50 (retail) worth of RAM. There's a bit more excuse in laptops that use LPDDR, which has to be soldered, and the M1 which gains some power advantage from integrating the chips into the package, but even on the Intel 5k iMac they want $200 to supply two bog standard 8k SODIMMs ($90 retail for the pair from Crucial) - in place of 4k ones (probably about $50 if Crucial even bothered to sell them) - so I doubt that they're cuttin' their own throats on the M1 RAM upgrades.
...unfortunately I doubt the handy RAM hatch on the 5k iMac will survive, although there's no particular need to use ultra-low-powered LPDDR on a desktop machine. AFAIK the ultra-short leads thing is primarily about speed/power trade-off.