What is the main problem that makes a person get pcos? Is it preventable?

Overweight. The majority of people with pcos have pre-diabetes. People with pcos are at very high risk for diabetes. There is a genetic (family history) component to pcos and diabetes, but daily exercise, staying at a healthy weight and eating a healthy diet that is very low in saturated fat is vital. There are some (very few) pcos women who are thin and the disorder is purely genetic.
Hormonal imbalance. Pcos is caused by high estrogen combined with high Insulin which then transforms estrogen into testosterone. A low carbohydrate diet is needed. Also iodine deficiency can contribute to this problem. Saturated fat is not a problem in this disease.