The epidermis is primarily composed of three types of cells - keratinocytes, melanocytes, and Langerhans cells. Keratinocytes are the most abundant cells and produce the protein keratin, which is a major component of hair, nails, and the epidermis. Melanocytes produce the pigment melanin, which helps protect the skin from harmful UV rays. Langerhans cells are part of the immune system and play a role in protecting the body against pathogens.