Why does an Arduino Uno have 2 microcontrollers
Atmega328P is a microcontroller which are the heart of Arduino Uno, where the Atmega8U2 is the USB to serial convertor for arduino communicated with computer.

You can refer to this link for more information about this.