I personally think that there are both genetic factors and environmental factors involved in the development of new onset diabetes.
My parents both have type 2 diabetes. But they both developed it in their fifties. I developed it at only age 25 when I was not obese or leading a very sedentary lifestyle. I was under a lot of stress though. I was working three different jobs and also studying. I was under a lot of pressure and I think that stress became the tipping point for me. I can't find any other reason for why I developed new onset diabetes so early.