The phrase amphoteric describes a compound that reacts with both acids and bases.
NaOH can react with both AlCl3 and MgCl2 to give a white precipitate but the addition of excess NaOH causes the amphoteric Al(OH)3 to dissove, whereas the magnesium precipitate does not dissolve with excess NaOH.
Al3+(aq) + 3OH-(aq) -> Al(OH)3(s)
Al(OH)3(s) + OH-(aq) -> [Al(OH)4]- (aq)