Hi,
DC motors have commutators inside. They create sparks. Those sparks create HF.
So a capacitor connected next to the motor terminals keeps this "HF loop" small, thus radiation is small.
It reduces differential mode HF current flow through the wires.
You talk about "toys" and "capacitor to the ground". There are several grounds. System ground, Earth ground, shielding ground.....
Toys often are not connected to Earth Ground.
And for HF radiation true EARTH ground does not play a big role, because of lengthy and high impedance wiring.
So maybe shielding ground.... Connected to the metal case of the motor, or a metal enclosure, or cable shielding..
Here the "capacitors to ground" may help to reduce "common mode" HF.
BTW: be sure the DC motor is not controlled by PWM. With PWM the capacitor may be counter productive.
Klaus