Diabetic ketoacidosis (DKA) is a medical emergency that can happen in people with diabetes mellitus. DKA happens mostly in people with Type 1 diabetes, although it may happen in some people that have Type 2 diabetes.

DKA happens when a person does not have enough insulin in their body.  All of the cells in the body need glucose (sugar) to survive, because the body needs sugar to make energy.  Insulin breaks down glucose into a form that the body can use for energy.  Without insulin, sugar stays in the blood and cannot get into the cells.  This causes high blood sugar levels and makes it impossible for the cells to use glucose to make energy.

DKA can be caused by not having enough insulin, eating too many carbohydrates, and sometimes physical or mental stress.  DKA can also be a sign that a person has diabetes that has not been discovered, or is not being controlled well.

DKA is diagnosed through blood and urine testing.  These tests will show high blood sugar, which does not happen with other forms of ketoacidosis.

DKA was first discovered around 1886.  Before insulin therapy was first used in the 1920s, DKA almost always caused death.

Symptoms 
Symptoms of DKA include:
 Nausea and vomiting
 dehydration
 The "3 polys" of DKA:
 Polydipsia (feeling very thirsty; this is caused by dehydration)
 Polyphagia (feeling very hungry; the brain realizes the body's cells are not getting enough sugar and triggers hunger, because normally eating would give the cells the sugar they need)
 Polyuria (urinating a lot; this is the body's way of trying to get rid of the extra glucose in the bloodstream)
 A "fruity" smell on the breath (acetone breath, caused by the body trying to blow off the acids and waste products created by DKA)
 Abdominal pain

As DKA gets worse, it can cause these symptoms:
 Confusion, which becomes worse and worse (because the brain is not getting enough sugar to work properly)
 Lethargy (feeling very tired), because the body is not able to make enough energy
 Eventually, the person will go into a coma because the brain does not have enough sugar to stay awake 
 Kussmaul respirations (breathing that is deep, gasping, and difficult), because the body is trying to blow off extra acids

Without proper treatment, DKA can cause death.

How Does DKA Happen? 
First, because there is not enough insulin to bring glucose into the cells, glucose builds up in the blood.  This causes there to be too much sugar in the blood and not enough in the cells.  The cells start starving, because they do not have insulin to break down glucose into a form that the cells can use for energy.

To try to create energy for the cells, the liver breaks down fat into fatty acids and ketones.  These create a little bit of energy, but they are also acidic.  The blood starts to get too acidic, and the body starts to get poisoned.

Because the cells still do not have enough glucose to create the energy they need, the liver also breaks down glycogen to make more glucose.  (The body stores sugar in different forms in case it needs energy later.  Glucagon helps break down some of these sugar stores into glucose.)  However, there is still not enough insulin in the blood to break down the glucose into energy.  Because of this, the glucose stays in the blood (making the blood sugar levels get even higher) and the cells keep starving.

Next, the body begins to break down protein.  (When the body cannot create enough energy by breaking down fat and glycogen into sugar, it breaks down protein.)  This causes the tissues in the body to lose nitrogen.

Now there is much more glucose in the bloodstream than in the cells.  The body always tries to stay in homeostasis.  In homeostasis, there would be an equal amount of sugar in the bloodstream and the cells.  To try to make this happen, the cells (which have very little sugar in them) give up water to the blood (which is very sugary).  The goal is to try to dilute the sugar in the blood, and decrease the high levels of hyperglycemia.  If the cells give up too much water, they can get dehydrated (not have enough fluid left in them).  Because DKA also causes a person to urinate often, a person with DKA can get dehydrated very quickly.  This dehydration can be a medical emergency.

The kidneys try to filter out the extra glucose in the bloodstream.  This causes glucosuria (too much sugar in the urine).  The extra glucose going through the kidneys causes more urine to be created.  When a person urinates more, they lose more electrolytes, like sodium and potassium.  Without enough electrolytes, the heart, muscles, and nerve cells cannot work properly.  Also, eventually, the kidneys can fail because they are overworked by the amount of glucose they are trying to filter.

Treatment 
People with DKA need to be treated in a hospital.  Usually, treatment involves:
 Giving insulin.  Insulin reverses all of the changes in the body that cause DKA.  It brings sugar out of the bloodstream and into the cells.  Once the cells have enough insulin, they can break down glucose to get energy.
 Giving fluids.  Because people with DKA can get so dehydrated, they are usually given fluids.  Fluids may be given by mouth or through a needle placed in a vein.  The extra fluid helps dilute all the sugar in the bloodstream.  It also replaces the fluids that people with DKA lose by urinating so much.
 Giving electrolytes.  Not having enough insulin can lower the amount of electrolytes in the blood (see "How Does DKA Happen?").  To fix this, electrolytes can be given through a needle placed in a vein.

References

Diabetes mellitus
Diseases