The pwm is used for components that work with inertia like motors because it will not be affected by fast changes as its reaction time is long due to its inertia.
The purpose of the pulse width modulation is to create an alternative between the highs and lows of the Arduino board, in order to have half the power for example. For this there will be cycles of periods and the pin will be turned on and then off.
For example if we take a period of 20 ms, which gives a frequency of 200hz (f=1/T), if the led is on for 10ms and off for the same time, then it will be a power divided by two or 50% of its maximum brightness.
To use the pwm, there is a function made for that, called analogwrite. This function takes as parameters the pin you want to turn on and a number between 0 and 255 corresponding to the voltage. 0 corresponds to 0V and 255 to 5V.
analogWrite(pin, value)
The motorshield card is used to control a motor. It will allow you to control its speed and direction (clockwise or not).
With this card you can control up to two DC motors at the same time, vary their speed, change direction with an h-bridge. Some boards are even able to control a stepper motor.