Causes of diabetes

Looking around on Google I found lots of sites stating poor diet e.g. sugary foods and drinks as a possible cause of Type II diabetes and others state obesity as a likely cause. In my book the two are not one and the same, someone could have a very poor diet but remain at or around their ideal weight due to their metabolism whereas another person could eat healthily with lots of fruit and vegetables but still be overweight.

So, my question is; Is being overweight a cause of diabetes by itself or does it have to be accompanied by poor diet? Is the person who eats lots of fruit and veg and never touches sugary or salty snacks (but is still overweight) at a greater risk of developing diabetes?

EDIT: I also want to ask, if that is the case, why? What is it about being overweight that causes diabetes as most websites I looked at stated high sugar/salt/fat diet as a cause, what about being overweight causes diabetes?

I don’t want to over simplify, but basically, Type 2 diabetes is caused by a strain on the pancreas - usually from being overweight, or from old age - that causes it to not work efficiently.

The Mayo Clinic’s description says that we don’t really know:

Recent research suggests that the body’s fat stores act as an endocrine organ, so there’s that possibility.