Atopic dermatitis can be inherited and is caused by a defective skin barrier. The skin does not do a good job of keeping moisture in and irritants and allergens out. Eczema often gets worse with certain triggers, such as dry skin, infection, allergens, stress, heat, and sweating.