Acne usually occurs when the pores of your skin are blocked. There may be one of the 4 major factors behind the issue:
Your skin produces excess sebum (oil) that blocks your pores
Too much dead skin cells clogs your pores
The buildup of Bacteria causing inflammation
Release of certain inflammatory chemicals that lead to redness and swelling
As your pore becomes blocked, it may swell and produce a whitehead that is closed under the surface of your skin, thus, having a white appearance.
On the other hand, a blackhead may look like dirt stuck in pores; however, oil and bacteria have plugged it. As it is open at the surface of your skin and exposed to the oxygen in the air, therefore, it gets its black appearance.