Although aluminum metal sits well above hydrogen in the activity series, it reacts only slowly with dilute acids because a thin coating of aluminum oxide protects the metal surface.
Aluminum reacts with alkaline solutions to produce hydrogen because the excess hydroxide ion first attacks the tough Al2O3 layer so the metal can react.
Aluminum converts to the tetrahydroxoaluminate ion Al(OH)4–.
Slow addition of acid to a solution of this ion causes the precipitation of solid Al(OH)3 followed by the dissolving of the precipitate to form the aluminum ion Al3+.
The solid Al(OH)3 will also dissolve in excess base due to formation of Al(OH)4–. We call a hydroxide that can react with either acids or bases amphoteric.