Microcontrollers are compact integrated circuits designed to perform specific tasks, unlike general purpose microprocessors. Microcontrollers contain a CPU, memory, and input/output components all on a single chip, making them well-suited for use in compact systems like vehicles, robots, smart homes, and medical devices. They are programmed to read input from sensors, perform operations, and output results to displays or other devices based on the programmed code.