Nice shot!
Lots and lots of practice.
Remember that a deer has legs that are swinging around, a head attached to a neck, fur and all kinds of other movable parts. If you're using a shutter speed slow enough to blur the background as you pan there is going to be some motion blur in the deer itself. On the other hand with a 200 mph stock car all of the parts of the car (except the wheels and tires) are moving together, at the same speed in the same direction hence no noticeable motion blur in the car.