Generally, pathogens does not enter into fruits even if plant is irrigated with contaminated water (Link). Hence , an unpeeled fruit should not have pathogen inside to rot it. Why does then an unpeeled fruit rots ? Does a rotting fruit is caused by pathogens ?
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
Pathogens are everywhere in the environment - in the field where the fruit grows, in the supply chain, and in your own kitchen. The only thing the linked article says is that, when the soil is contaminated, the human-pathogen bacteria don't travel up the roots into the fruit. But you still have pathogens on the surface. Also, you seem to be throwing plant pathogens and human pathogens into the same bucket.
A whole plant usually has sufficient defense mechanisms to stop bacteria from consuming it. But a picked fruit, even though still alive, is not a whole plant. Its metabolism gets disordered with time, and its defenses fail. Also, its tissue can soften and its cell walls can fail. The bacteria which are on the surface, or have entered it through places of mechanical damage, start gaining the upper hand. Or if not bacteria, then mold or viruses can also start feeding on the fruit.
In short, fruit is not sterile, nor is it endlessly protected against decay.