The epidermis is the outermost layer of the skin, serving as a protective barrier against environmental factors such as UV radiation, pathogens, and chemicals. It is primarily composed of keratinocytes, which are cells that produce the protein keratin. The epidermis also contains melanocytes, which produce the pigment melanin, and Langerhans cells that play a role in immune response.