When the pores are closed (or half closed), sebum that is being produced by the oil glands and that lubricates the skin, collects under the skin since it has no place to go.
Your body has what are called pores, and they get clogged from everyday germs in the air. Sometimes this causes blackheads and they turn to pimples and surface.