What is the purpose of the capacitor on the I/O pins on the ATmega328 (I imagine it's on other AVR microcontrollers as well)? Is it to reduce noise from other parts of the microcontroller?
The pin does not have a capacitor added to the integrated circuit (IC). Rather this capacitor is drawn to show that the input has capacitance that you need to be aware of.
The input drives a MOSFET - and as we know, MOSFETs have some parasitic capacitance.
For more information on parasitic capacitance of MOSFETs see these pages: