For the same reason, when you turn off the motor, the natural tendency is for it to stop immediately, with the same effects. If the motor is used to move a robot, for instance, this abrupt stop can cause it to fall over.
With the block shown in Figure 1, we can add some inertia to a dc motor.

This means that, when you power up the circuit, the motor produces a “soft” start, because the capacitor must be charged. This is shown by the curves in Figure 2.

By the same principle, when the motor is turned off, the energy stored in the capacitor is released, powering down the motor over a few seconds. The larger the capacitor, the more inertia is added.
In a robot, for instance, this means that the machinery doesn't encounter a sudden stop when the motor is turned off; due the inertia, the stop is soft.
You can experiment with capacitors with capacitances between 100 and 4,700 µF, or even higher depending the application, when using motors up to 1 A and 15 V.