I am not an engineer but I think iPhones work exactly the same way and that's why they have less RAM than android, and iPhones have flash storage too.
Well, iPhones don't work the same way at all. iOS will simply just kill your app if it doesn't have enough memory, and... all iOS apps are designed with very aggressive memory management in mind.
The fundamental difference between iOS and MacOS in this case is that iOS does not write to storage when memory runs out, but MacOS does.
And writing too many times to the flash storage kills it.
Ontrack discusses SSDs, physical faults, malfunctioning controller and storage chips, and hazards of recovering data with data recovery software.
www.ontrack.com
This article explains it pretty well. Most manufacturers now rate their SSDs at around 150TB written before they don't warrant it anymore. So you need to write about 410GB/day for the SSD to get into "no guarantee" zone, or about 100GB/day for 4 years straight.
If you're using swap any less than that, your drive should last up to 4 years at least. Heck, if you're constantly writing 10GB daily, the drive will last 40 years before it hits the "no guarantee" zone. Imagine that...
So even though it is a concern, I don't think it's a realistic concern in 2020. Just use the computer as is if hitting swap doesn't cause it to slow down.