STAN walk 10 km to the grocery store.
He stops then walks 10 km east back to his house.
Let us draw this situation to better understand the problem.
As you can see, Stan first walked to the grocery store and covered a distance of 10 km then he came back to the house from the grocery store and covered a distance of 10 km.
So the total distance is 10 + 10 = 20 km
On the other hand, notice that Stan is exactly at the point where he first started that is his house, therefore, the displacement is 0 in this case.
Recall that the displacement is a vector quantity so the direction of travel also matters.
From house to grocery store = 10 km
From the grocery store to house = -10 km
Overall displacement = 10 km - 10 km = 0 km
Therefore,
Distance = 20 km
Displacement = 0 km