It is up to you to make sure that your cam is least likely to walk. Ironically the perfect width crack is your worst enemy for this. Even if you have placed properly and pointed the cam down at a diagonal angle the cam may still walk. Of course extending with a runner is very important as the rope can then move around hopefully without wiggling the cam, but sometimes one doesn't want to extend or your route still results in the wiggling of the cam. If it gets wiggled it will walk, so look at how you can place it against a bulge or feature that will stop that happening. So - as always- try and find a spot where the lobes are all evenly extended and maybe the top of one or two of them are touching against something that prevent it wriggling in further. Often turning the cam around through 180 degrees will help. I always remember that placing a cam properly is directly proportional to your confidence when above it, which is why just grabbing a cam and shoving it in is a desperate move for desperate times.

Basically don't be lazy and look at how you place and do your best to make sure you can retrieve the cam!

i find that people tend to place cams under-cammed rather than over-cammed - over-cammed is literally only the last 2 or 3 percent of the lobe; whilst under-cammed is the bottom 50%. see metolius's placement guide below - the green zone is only the top half of the lobe; the yellow is acceptable but not ideal and red is taking a gamble ..... and under-cammed cams tend to walk more since the spring is more relaxed (i think?).

Over cammed cams can generally be removed with patience and a patient belayer who will hold you in one position for some time.

Use two nut picks and hook them behind the cam lobes, against the rock, one above, one below. Pull the nut picks towards you. They will either slip between the lobe and the rock or catch the lobe. If the former, apply a little tension to the cam sling and repeat. If the latter, tug alternately on the picks, making sure to switch sides every now and then. The cam should, very gradually, move towards you.