The exact cause or causes of gestational diabetes are not known. But there are risk factors that can increase the chances of getting it. As with any disease, risk factors are not a guarantee that you will contact the disease, they just make the likelihood of getting it higher. Some of the risk factors you will have control over and some you do not.
A family history of diabetes will increase the chances of developing gestational diabetes in pregnancy. The closer the relative is to you (first generation like a parent) means the risk is increased. If your family suffers from diabetes, your own pancreas may not be able to produce the amount of insulin necessary while pregnant. This deficit combined with the hormones released by the placenta can lead to diabetes in pregnancy.
Women who are overweight and are clinically considered obese run a higher risk of being diagnosed. The excess weight puts a strain on your body, including your pancreas, and makes it hard for enough insulin to be produced and used by your body effectively.
If you have had a previous baby with a higher than average birth weight, you are considered at risk for your next pregnancy of getting gestational diabetes. It could have been possible that you had it in your first pregnancy and it went undiagnosed. Babies born from moms with diabetes in pregnancy tend to be larger unless her blood sugars are strictly managed. Or if you had diabetes in your first pregnancy, chances are very high that you will get it again.
Since there is still no known cause a woman may have all of these factors or none and still get diabetes. It is best to attend all of your prenatal appointments with your Doctor during your pregnancy period so that your Doctor can thoroughly be examining you on the lookout for any signs that you may have either other thing in your pregnancy or gestational diabetes.