An embedded system is a combination of hardware and software designed for a specific task. It contains a microcontroller or microprocessor that executes programmed instructions. A microcontroller contains a CPU, memory, and programmable input/output peripherals on a single chip. The Atmega8 is an 8-bit AVR microcontroller developed by Atmel with 8KB of flash memory. It has ports that can be configured as inputs or outputs using data direction registers to interface with external devices like LEDs for blinking. Programming the microcontroller involves writing code, compiling it, and flashing the hex file onto the chip.