ESP32's are on the high end of FLASH and RAM counts. You are pointing out that there is variance. The kind sof 2-8$ MCUs I've used generally have 512k-2Mb[it] onboard flash and <512k SRAM. (STM32G4, H7, ESP32C3 etc)
The Sub <$1 you refer do will have <100k of these. (STM32C0, G0 etc)
ST is actually moving away from the 2Mb MCUs, and instead offering ~1Mb with Octospi. I believe the intent is to use offboard flash if you want more. (e.g. the newer H7 variants)