how does acid work chemistry