Diabetes mellitus due to underlying conditions may arise from endocrine disorders, such as Cushing's syndrome or acromegaly, which disrupt normal glucose metabolism. Additionally, certain medications, including glucocorticoids and antipsychotics, can induce insulin resistance or impair insulin secretion, leading to drug-induced diabetes. Chemical exposure, such as from certain industrial solvents or toxins, may also play a role in the development of diabetes in susceptible individuals. Lastly, genetic factors or specific diseases affecting pancreatic function can result in other specified types of diabetes.