Displacement is a vector quantity in such a way that it only takes into account the final and initial position of a body while the distance takes into account all the distances that have been traveled. When the trail is a straight line, the magnitude of the displacement and distance should only be the same.
When you are hiking along a trail, you will be taking some turns and not all direction will going up, some will be even horizontal. The distance you will travel will be the total length you walked along the trail. The displacement is the just distance between your starting point and where your final destination is.