Head shaking is not as common in cats as it is with dogs and when it does occur it almost always relates to a problem with the ears.
Most causes of head shaking relate to discomfort due to itching and inflammation. As the cat scratches his ears and shakes his head, he risks further aggravating the problem by inducing an ear hematoma, which is a blood-filled pocket caused by a broken blood vessel in the ear.