A pimple is a type of skin lesion that is caused by inflamed and/or obstructed pores . The most common cause of pimples is acne .
A pimple is a result of a blockage of the skin's pore.
Behind the pore are sebaceous glands which produce sticky Sebum . When the outer layers of skin shed (as it does continuously), the dead skin cells left behind may become 'glued' together by the sticky sebum. This causes a blockage in the pore. The sebaceous glands produce more sebum which builds up behind the blockage, and this sebum harbours bacteria (P.Acnes bacteria). Since the body's natural defence against bacteria is primarily Phagocytes (white blood cells), these rush to the site behind the blockage (where the bacteria are). This is what gives some pimples the 'whiteheads' (unless the Phagocytes are deeper in the skin, which means you can't see the 'white' caused by them). The white blood cells then destroy (by Phagocytosis ) the bacteria to prevent infection.
source wikipeida