The capacitor seen on a lot of brushed motors is there to absorb RF noise due to the arcing as the brushes commutate. You often see these on the motors used in RC cars, where the motors are fairly powerful and spinning fast.
The problem comes when you are using PWM to drive the motor. At the beginning of the duty cycle, when the current is switched on, you'll see a current spike as the current rushes into the capacitor from the H-Bridge. This inrush current can sometimes cause noticeable voltage ripple at the power supply, adding noise into any sensitive analogue sensors.
To prevent the inrush current, you can add a pair of inductors between the H-Bridge and the capacitor. This will hold the current fairly steady. Actually, you'll often see inductors on motor drive circuits anyway. Even though the motor itself is an inductor, it's often quite a low inductance, so extra inductance is added to help smooth out any current fluctuations when using PWM drive.
The capacitors have nothing to do with protecting the motor in the case of a stall. When the motor stalls, the current increases and you risk overheating the motor.