static charges build up as your tires roll down the road. If there is not much moisture in the air, as in the winter months, the static charges build up.
when you step down your car and touch any metal part, the static charges drain off the car through you, into the ground.
to prevent being shocked, i make sure i don't hold any metal part of the car as i step down into the ground (holding the interior plastic parts of the door will do). I then hold the metal part of my key and touch the surrounding metal of the keyhole. You can see a small spark generated (if it is sufficiently dark) as the static charges drain off.
when filling up the car at a gas station in the winter, i make sure that the static charges are fully drained, because i don't want to do that and generate a spark with the fuel filler nozzle as it makes contact with the area around the gas tank opening (!)
some cars have static drain strips hanging off their chassis and touching the ground at all times, to prevent static buildup. Benz uses plastic-coated doorhandles and this helps prevent shock a little.
i get more shock when i get my bill after major repairs or maintenance ... :-0