Biting on aluminum foil can be painful and is usually noticed if you have metal in your mouth from dental work (e.g. fillings, crowns). Basically, when you bite on foil, you set up a battery in your mouth and the electrical current stimulates nerve endings in your tooth. Here is what happens:
1. pressure from biting brings two dissimilar metals (aluminum foil, mercury in fillings or gold in crowns) in contact in a moist, salty environment (saliva)
2. the two metals have an electrochemical potential difference or voltage across them
3. electrons flow from the foil into the tooth (i.e. electrical current)
4. the current gets conducted into the tooth's root, usually by the filling or crown
5. the current sets off a nerve impulse in the root's nerve
6. the nerve impulse is sent to the brain
7. the brain interprets the impulse as pain
The production of electric current between two metals in contact is called the voltaic effect after Alessandro Volta, who discovered it. Early batteries were made by stacking metal discs together in a pile called a voltaic pile.
If you have no metal dental work in your mouth, you should not feel this effect.