Why does unpeeled fruit rot?
Rotting occurs as cells break down and autolyse together with other chemical reactions and aided by microbial (fungal and bacteria) contamination.  It is not initiated by pathogens, but is rather a normal cause of events.

Note that ripening (i.e., the earliest stage of rot) and fermentation (e.g., beer and kimchi) are related processes performed under controlled conditions