How the body protects itself from type 2 diabetes