Apples, and other fruits like pears, bananas, peaches, potatoes, contain an enzyme (called polyphenol oxidase or tyrosinase) that reacts with oxygen,and iron-containing phenols that are also found in the apple.
The oxidation reaction basically forms a sort of rust on the surface of the fruit. You see the browning when the fruit is cut of bruised, because these actions damage the cells in the fruit, allowing oxygen in the air to react with the enzyme and other chemicals.
All cells contain thousands of enzymes. These enzymes do all of the work necessary for the cell to live its life. Once you cut the fruit, you open up some of the ells. The enzyme then has access to oxygen in the air and it does its thing, turning the fruit brown. This is the same thing that causes brown spots in apples when you drop them.It is believed that is reaction, called enzymatic browning, is a form of plant defense against pests and pathogens.