If you climb a 100 foot hill, turn around and ride back down to where you started, your ride has 100 feet of climbing, even though you are starting and ending in the same place.
A 50 mile ride in a flat area might have only a few hundred feet of climbing. 50 miles in a hilly area might have 2000 feet of climbing. 50 miles in the mountains might have 5000 feet or more of climbing.