Theres lots of threads about this, but -
Any inductive load which is switched on an off (which includes, but is not limited to motors and relays) produces a resonant signal in its wiring. Since this is a broad radio frequency signal, the wiring acts as a transmitting aerial, providing a locally strong signal very close to the receiving aerial. Motors with brushes are most likely to introduce this unwanted signal, known as "noise", which the receiver will do its best to resolve as an instruction.
Motors with poorly designed/engineered brushes and commutators have the ability to make more noise. The addition of suppression components restricts the signal produced by the motor, hopefully, to the motor and stops it transmitting. Capacitors form what is effectively a short circuit for the radio frequency signal, inductors placed in the leads form a DC blocking component.
You can, if you really want to, calculate optimum values, or you could do it the easy way like the rest of us, and do a search on an appropriate forum to find out what works for everybody else. Or just look on the local hobby shop shelf for a pack of suppressor capacitors. Sometimes, you even get instructions in the box that the motor came in.