Diabetic ketoacidosis (DKA) is a severe complication of type 1 diabetes and it is less common than type 2 diabetes. Diabetic ketoacidosis occurs when your blood sugar is very high and acidic compounds known as ketones build up to dangerous levels in the body. It is caused by high blood sugar levels (also known as hyperglycemia) and acid buildup.
It is important to not confuse ketoacidosis with ketosis, which is harmless. In most cases, ketosis occurs because of a very low carbohydrate diet, known as ketogenic diet or fasting. Diabetic ketoacidosis only occurs if there is insufficient insulin in the body to process high levels of glucose in the blood.
It is less frequent in people with type 2 diabetes because insulin  levels don’t drop so low. In most cases, diabetic ketoacidosis is the first sign of type 1 diabetes, because people with this disease cannot make their own insulin.