Ok.
1. Trauma: When a bullet goes through you, the bullet is going to tear a hole. Depending on the type of bullet and what it hits, the bullet may fragment and besides the main wound channel, there may be a large number of secondary wound channels. If these wound channels go through major organs such as the brain, nervous system, lungs, etc, the trauma can cause death outright.
2. Blood loss: A common cause of death from gunshot wounds is blood loss. The bullet passes through an artery, you will bleed out. If a bullet or fragment punctures organs such as the liver, the injury itself may not be life threatening, but the massive blood loss as the result of the injury can be life threatening.
3. Primary and secondary infections: If you were to get a flesh wound through your arm that normally wouldn't be life threatening and pack the hole with dog feces, without proper treatment, the wound could be deadly as the result of infection. Bullets allow a way for bacteria and microbes to cause infections. Infections can kill you.
4. Hydro-static Shock: The concept of hydro-static shock can be debated, but I believe it is generally accepted as fact. Basically, this is energy transfer. Think of walking up to the kids' swimming pool and hitting the surface hard with your hand, you cause waves. The energy from your hand is transferred to the water and causes motion in the water. A bullet will do the same thing in your body (which is mainly water). The energy is believed to be transferred into the surrounding tissue in a ripple effect that dissipates the farther away it gets from the point of impact. These waves are believed to cause disruption in the central nervous system and can cause trauma at points close to the bullet without the bullet actually touching the area.
So if someone were to walk up to you and put a bullet in your thigh, would it be fatal? With basic first aid and the common availability of medical care and antibiotics, probably not. The bullet could hit an artery and you could bleed to death. You might get an infection that takes over your body. You won't die from direct damage from the bullet or hydro-static shock, but it could be fatal all the same.
The probability of dying from a gun shot to the leg is much, much less than say dying from a gunshot wound through the heart.