Permanent, semi-permanent, and temporary hair dyes work through different chemical processes to change hair color. Permanent dyes use oxidative dyes to permanently change the color by penetrating the hair shaft. They contain chemicals like PPD and ammonia which can cause skin and respiratory irritation. Temporary dyes form a coating on hair that washes out and are generally safer but do not penetrate the hair. Both types aim to match, lighten or cover gray hair but permanent dyes carry more health risks like potential skin discoloration or hair damage from the chemicals used.