Procedural photography! If I had to bet, your phone probably took a massive stack of photos and stacked them to have that much depth of field, even on a sensor as small as what resides in a cellphone.
Dedicated cameras are great for motion, telephoto, and low light but I really wonder what Samsung would be up to these days if they had kept going on their interchangeable lens cameras. Standing cameras these days have fantastic hardware with software that feels stuck in the early 00s.