If you have read How Cells Work, you know that all cells contain thousands of enzymes. These enzymes do all of the work necessary for the cell to live its life. According to this article, the actual mechanism that causes browning in apples and potatoes involves an enzyme called polyphenol oxidase, also known as tyrosinase.
...the browning reaction results from the oxidation of phenolic compounds in the fruit under the action of an enzyme called polyphenol oxidase (PPO), which is common in plant tissues.
Once you cut the fruit, you open up some of the cells. 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.
The easiest way to prevent browning is to put the sliced apples in water so that the enzyme does not have access to oxygen. You can also heat the apples to denature the enzyme.
In humans, tyrosinase is also important because it helps create melanin, which causes tanning. The lack of tyrosinase in humans leads to albinism. So in humans, the browning that tyrosinase helps cause is actually a good thing!