What causes leg edema?

Fluid retention. There are many causes of this fluid retention some very serious such as kidney failure, heart failure, cirrhosis of the liver and portal vein blockage in the liver. Less serious causes include varicose veins, and excessive salt in the diet. Infrequent causes can be blockage of the veins in the abdomen. Single leg edema can indicate a dangerous clot in the leg. See your doctor.
Many possibilities. Some causes of swelling of the legs can include systemic problems such as hypertension, and problems with the kidneys and localized issues such as arthritis, infection, lymphatic obstruction, blood clots, varicose veins, trauma (fracture, sprain, tendonitis) and side effects to medication. Have it evaluated by a professional and get the appropriate treatment.