What is the role of these capacitors?
This is not an op-amp, not even an approximation to one, it's a fixed gain power amplifier. That image is figure 16 from the TI datasheet for LM386. Unfortunately it only explains the function of cap A, which is peculiar to the detailed circuit of the 386.

Cap A short circuits a gain setting resistor to change the amplifier gain. It has to be large enough to couple the internal resistor, in the order of 1k, down to bass frequencies.

Cap B is an AC coupling (aka DC blocking) capacitor always found on the output of a power amplifier that has a DC bias on its output. It has to be large enough to couple the speaker's impedance, typically 8 ohms, down to bass frequencies.

Cap C is part of a so called Zobel network frequently found across the loudspeaker terminals of power amplifiers, designed to compensate for the inductance of the speaker, to keep the amplifier stable. It is sized assuming a typical low power speaker that would be appropriate for that size of amplifier.