A sprain should not be confused with a strain. Sprains are a similar type of injury but they are much more serious. A sprain is the tear of a ligament. There are 3 different degrees of ligament tears.
As you can see in the figure above, the grade 1 sprain is just some minimal tearing of the ligament which probably only needs ice, elevation and support from an ACE bandage to recover. The grade 2 is a partial tear. A doctor should be seen and they may recommend surgery depending on the severity. A grade 3 sprain is a complete tear of a ligament and surgery is necessary to repair the tissue.
This injury occurs at joints because that is were ligaments can be found. They most commonly occur in the ankle and wrist joints.