https://www.linuxatemyram.com/
The above is very similar to how iOS handles cache. As I said, research cache and flash memory and how they work together. You cannot learn unless you look it up. Being incurious doesn't change the facts.
Original thread: https://forums.imore.com/threads/is-there-an-app-that%E2%80%99ll-clear-your-iphone%E2%80%99s-cache-check-battery-health-etcetera.405146/