They’re all inaccurate or inconsistent in various ways, some more than others.
Phones generally lack barometers so elevation will be based on topographical data from Strava, but that is restricted by the resolution of the data, so a 100m square for example may appear flat to Strava but goes up and down a lot in riding. Barometers in Garmin’s etc will pick up that detail, but they are based on atmospheric pressure and need calibrating, ideally adjusting for conditions during the ride especially if it’s a long ride. Which isn’t practical. Hence why mine can end up 100ft above/below where I started even ending at the same location as the start.
Distance gets skewed by straight lining when GPS lock is lost or fix drops accuracy, especially when in tree cover.
A GPS device may have better receivers and may have GLONASS support as well as US GPS, although modern phones tend to these days anyway.
You can also get speed sensors for some GPS devices and that will track the actual wheel distance (though needs calibrating for wheel size). That may be more accurate than GPS distance.
Personally I go with an independent device more for battery life anyway. It’s not draining the phone and experience has taught that I need a phone to call for an ambulance. Or at least to take loads of arty photos 😀
On accuracy, I wouldn’t get too hung up on it. So long as your device is consistent and you can compare your own rides against each other. Comparing against other people is relatively pointless as the devices vary so much, even same make/model. A curiosity and bit of fun to compare, but leave it at that.