In both cases, the anions are stabilized by resonance.
V oboch prípadoch sú anióny stabilizované rezonanciou.