There are many reasons why people might have a speech or language problem. Some people have lived with it since childhood. For some it might be genetic, others might develop an impairment following an injury (such as from being hit or from falling) or because of a medical condition, like a stroke.
Language difficulties are linked with specific damage to the parts of the brain responsible for understanding and using language (e.g. aphasia).
Speech difficulties are linked with altered control over the nerves and muscles responsible for speech. (e.g. apraxia/dysarthria/stammering).
It doesn't affect intelligence as people still think in the same way but are unable to communicate their thoughts easily.
Charities like the British Stammering Association and the Stroke Association have useful information on their website.