Lack of exercise can lead to type 2 diabetes by contributing to weight gain and increased body fat, particularly around the abdomen. This can lead to insulin resistance, where the body does not use insulin effectively, increasing the risk of developing diabetes. This highlights the critical importance of exercise in preventing type 2 diabetes.