Amalgam tattoos occur when small particles of dental amalgam, composed largely of silver (Ag) and mercury (Hg), are inadvertently implanted into oral soft tissues during dental procedures.