Question d’entretien chez onsemi

Explain what a voltage regulator does. What are the differences between a PMOS and NMOS?