These are generally called "Mats". They are particularly a problem with long haired cats, but short haired cats can get them too.
Prevention is quite simple, just brush your cat regularly and they are unlikely to occur. I'd recommend a strong wire brush for this, for example something like:
The other advantages of this are that your cat will most likely love it, and it will help prevent hairballs as well.
As far as what causes them I am not entirely sure, but I think it is probably similar to "Why do cords always end up getting tangled?"