Unhealthy eating habits are behavioral issues. The propensity to T2 is hereditary.
If T2 was entirely hereditary, it wouldn’t be reversible through through behavioral changes in diet and exercise.
That’s why it’s called a lifestyle disease.