My tuppence………..
My edge 305 uses GPS altidude data which is accurate to say 5m s.d. so the time weighted average is you stood still should be 100% accurate. However your not still, so its just plotting lots of elevation changes even as you ride allong a perfectly level road as theres no chance to take multiple readings.
IIRC the more expensive GPS’s use a barrometer, which is a more constant measurement (if you stand still it’ll stay still) but less accurate (upwind or downwind of a hill or a weather front for example) so it calibrates itself against the GPS regulalry, a bit like GPS’s that auto calibrate wheel size over time when sued with a speed sensor.
IME expensive GPS’s agree with maps within a pretty good degree of accuracy. Certainly accurate enough to start debateing whether you cycled allong a contour line on the map, thus crossing it often and gaining 10m ‘climbing’ each time you did or maybe zig zagging up and down between 2 contour lines doing a lot of climbing that woudl not be picked up by the map. Cheeper ones like mine I assume the climb or decent was 2/3 of the GPS recorded value over a few hours which pretty much agrees with the ‘corrected’ elevation.