Check out the picture I drew for a minute before reading this...
B. Distance [the red line] is a scalar quantity reflecting how far an object has traveled. Displacement [the green line] is a vector quantity reflecting how far an object has moved from a point. The key difference is that distance can be any sort of path while displacement is always a vector (or a straight line) between a starting point and a finishing point. Sometimes distance and displacement are equal to one another. Sometimes you have a distance traveled, but zero displacement overall; which is what's going on in your question.
A. The distance that the racecar traveled is indeed 500m. But at the end of the lap, it is right back where it started. So overall, it has been displaced 0m.