Doping introduces impurities into semiconductors to modify their electrical behavior. It creates either extra electrons (n-type) or holes (p-type) to control conductivity.