Gestational diabetes

Hannah
What causes women to have gestational diabetes? Is it from eating badly or what?