It's the least accurate part of GPS tracking. It works by triangulation, with satellites essentially looking from above, so hoizontal movement is more noticeable than vertical. Also will depend on exactly where you are each time a reading is taken (it plots a series of points rather than a continuous stream).
Best thing is to import to a website (e.g. Garmin Connect, or my preference Fetcheveryone.com, and save it as a course/route. There will usually be some form of elevation smoothing calculation going on, and because you have saved that route, it will show up as the same every time you have used it.
My experience has been that "elevation gain" can be wildly out as lots of very small variations add up to a big total, however the current elevation reading tends to be reasonably accurate - can be quite a useful extra piece of information when navigating in hilly terrain.