That is an Apple problem and keep in mind that iPhone doesn't do multi-task, the fact that you are having problems with 12GB is not surprised to me.
I have to use a Macbook M4 at work with 24GB, I have an AMD Lenovo Ryzen7 with 32GB running Linux Mint Cinnamon. It is infuriating how slow this Macbook is, even to shut it down is slow asf.
macOS is not different than Windows, I cannot wait for COB to get back to my Linux laptop.