Why does sleeping in the family bed cause sids?

Not the family bed. It is not specifically the familiy bed that leads to sids. And still despite risk factors there is not a known cause to the condition. Babies cannot protect the airway and should be free from loose clothing and bedding at night. Also parental or other siblings in bed may lead to infant injury, especially if those sharing bed have other illnesses or conditions.
Different issue. In the Bible, king Solomon's great wisdom was made history in a story of 2 women fighting over a baby.The one, had "overlaid"(smothered) her own. We lose about 100 infants a year who suffocate in family beds,with blankets or wedged into soft bumpers. This causes predictable suffocation and is preventable.We are not sure what causes SIDS, but it is not the family bed.