As a storage medium and DAC any smartphone works perfectly well. Measured performance of onboard DACs or low cost manufacturer supplied dongles may not be stellar but audible performance is fine. Keep in mind a DAP nowadays is in most cases just another Android device.
So why buy a DAP? Good question, the reality is you don't need to. I still have a Shanling DAP and it is good for times when I don't want to be connected to the world and at someone else's call but as an audio device it is no better than my phone. And in some ways a phone is better, the Android implementation is often better and battery life better. In fact a sensible option is to use an old phone or buy a second hand one purely as an audio player with no telecom connectivity.
You can spend a lot on DACs and dongles but unless you have hard to drive headphones almost any dongle is fine. If you have hard to drive headphones and want to go loud you will need an amplifier, but that's true for almost all DAPs too, most are designed around driving IEMs and efficient headphones, not hard to drive models
Really, to me the DAP still makes sense as an affordable alternative to relying completely on a phone but expensive models seem a bit pointless to me.
Another alternative not to be ignored is that wireless headphones and IEMs put the DAC and amplifier into the headphones/IEM and work extremely well.