The insides of APPLES turn brown when exposed to air thanks to a BUILT in defense mechanism against bacteria and fungus.
The trigger for this is damage to the cells, such as when you cut the apple, which then results in CERTAIN enzymes within the cells being exposed to oxygen.
When this happens, the enzymes react to the oxygen creating an oxidized LAYER that provides some protection against foreign bodies.