can you explain how the electoral college works the situations in which it has produced controversial results, and the criticisms leveled agains it

can you explain how the electoral college works the situations in which it has produced controversial results, and the criticisms leveled agains it