The epidermis is the outermost layer of the skin and serves as the body's first line of defense against infection. The other two layers of the skin are the dermis and, beneath that, subcutaneous fat.
The term “epidermis” comes from Greek: the prefix “epi” means “on top of”, so epidermis literally means “on top of the dermis.”
Besides the obvious function of protecting a person from foreign bodies, what else does the epidermis do?
Actually, it has many more functions than you might suspect! The epidermis creates new skin cells constantly which replace the dead skin cells on the surface of the epidermis. These cells are called keratinocytes, so-named because they create the chemical called keratin. This helps to reinforce the protective wall of the epidermis. These keratinocytes are the most common type of cell in the entire epidermis.
The epidermis is of course also waterproof, which is why we can swim without absorbing water. Well, for quite a long time - eventually your skin starts to get a bit wrinkly and puffy, starting with your fingers and toes.
The epidermis is itself divided into multiple subsections.
The uppermost of these layers is called the stratum corneum (Latin for “horny layer”) which is the toughest part of the epidermis. The toughness of this layer actually varies from place to place on the body: for instance, it's tougher on your feet than on your eyelids. This layer is composed largely of dead skin cells; amazingly, every 35 days the dead skin cells of the stratum corneum have been completely replaced.
These replacement cells are produced beneath the stratum corneum in the stratum basale (“basal layer) which consists of stem cells which are constantly producing new cells, the keratinocytes mentioned above. The keratinocytes migrate upwards as they mature, going on to become the dead cells of the stratum corneum.
The primary function of melanin is to protect the body from the ultraviolet rays emitted by the sun. A third type of cell, which is present in the stratum corneum, are Langerhans cells, and these help to defend the body against infection.