There are two main reasons for using filter caps with the power supplies (especially when using an inductive load with a high transient current demand i.e a high torque DC motor).
1- A reservoir capacitor (usually a large value 1000uF or more) is put between the power and ground. It acts as a voltage /charge reservoir for small periods of time when the motor draws a high current (i.e when you abruptly change the motor direction).
2- A filter capacitor (usually a couple of capacitors, 1uF and/or lower). Then tend to provide a low resistance path towards ground for high frequency noise signals generated when then motor is operated. The motor tends to generate high-freq noise because it is operated at high PWM freq (sometime 20kHz and more to lower the audible 'humm' produced during motor operation).
The actual value of capacitor used is dependent on the the motor's transfer function / response to operation at high frequency, but normally it's just easier to go for a value of capacitor that would provide a low resistance/reactance to high freq signal. 0.01 uF between motor terminals is used for just the same purpose.
A word of advise though, if your motor draws close to 1A current or more current during operation, the best solution is to either optically isolate the logic circuits (Microcontrollers, sensors etc) from the motor power circuit or another good solution is to use a separate power supply for both circuits (don't forget to put them to a common reference in case of dual power supply).
Just don't let anyone tell you they know THE best way to deal with noise. The most effective way will vary by situation.
Well ok, I take back my verdict on the optical isolation solution being the best
it's just that normally what people describe the best is what works for them or whatever works for most of the people