What is the role of dopants in creating n-type and p-type semiconductors?

What is the role of dopants in creating n-type and p-type semiconductors? — Semiconductors | Unlo