Which one are you talking about Type 1, Type 2, Gestational diabetes, MODY, Prediabetes, LADA. I am listing the causes in simplified forms:
Type 1= autoimmune destruction destruction of pancreatic B islet cells.
Type 2= genetics and family history and many other factors causing tendency towards insulin resistance and hence causing pancreatic B islet cells failure/exhaustion.
Gestational Diabetes= pregnancy hormones causing insulin resistance.
Prediabetes= this Condition can lead to type 2 diabetes as its the start of insulin resistance
MODY(maturity onset diabetes of young)= Mutation in genes. Always occurs <25 years of age.
LADA(Latent autoimmune diabetes in adults)= slow pancreatic B islet cells failure due to autoantibodies so age is older as compared to type 1 patients. Very rare hence mostly being misdiagnosed as type 2 diabetes.