Strava and some other activity apps reference existing databases for elevation, based on map data and data submitted by users who post data based on their computers and phones. Presumably these are reasonably accurate. At least it offers a fairly consistent baseline.
My XOSS G+ bike computer has a barometric pressure sensor and the elevation estimates vary wildly depending on the weather. I never even look at it during rides.
And because my computer elevation data is unreliable, after syncing my ride to Strava, I then use Strava's options to correct elevation and distance. This at least makes the other data relevant in comparisons with rides on the same routes.