The skin has many layers. When a tattoo is injected into the skin, it is injected into the dermis. There it is taken up by the macrophages that accumulate it and give the skin its specific color. Above the dermis is the epidermal layer. This layer constantly keeps renewing itself and as it grows, the new cells are shifted towards the top.
The cells grow old and are shed. This is called exfoliation. This has nothing to do with the pigment injected into the deeper layers. This is why the tattoo maintains its color even after years of constant shedding of the skin.
The cells that exist in the superficial layer of the skin, also referred to as the upper skin layer constantly get replaced by newer cells. This is referred to as exfoliation of the skin. However, the lower skin layer referred to as the Dermis does not undergo this change.
The dyes of tattoos are implanted on the dermis and not the epidermis. As a result of this, the tattoos remain there even when the epidermis keeps shedding itself. The outer layer of the skin sheds because it is made of collagen which has to get repaired overtime.