In the LM386 datasheet it's stated that "If a capacitor is put from pin 1 to 8, bypassing the 1.35 kΩ resistor, the gain will go up to 200 (46 dB)".

I don't understand how this capacitor could bypass the resistor. I've tried simulating this scenario in EveryCircuit and current keep flowing in the resistor and it makes sense to me since DC won't flow into the capacitor.

They make it sound like by adding this capacitor the resistor will be shorted but I don't see how this could happen.

What are we trying to achieve in term of current/voltage flow here by adding this cap?

Here the term "bypass" means "bypass for AC signal voltages.
ie allow AC to pass without being affected by the resistor.

LM386 data sheet here

On page 3 they say:

• GAIN CONTROL To make the LM386 a more versatile amplifier, two pins (1 and 8) are provided for gain control. With pins 1 and 8 open the 1.35 kΩ resistor sets the gain at 20 (26 dB). If a capacitor is put from pin 1 to 8, bypassing the 1.35 kΩ resistor, the gain will go up to 200 (46 dB). If a resistor is placed in series with the capacitor, the gain can be set to any value from 20 to 200. Gain control can also be done by capacitively coupling a resistor (or FET) from pin 1 to ground.

Gain = 15,000 x 2 / (Ra + Rb)
Initially Ra + Rb = 0.150 k + 1.350 k = 1.5k
So gain = 2 x 15,000 / 1.500 = 20.
Shorting the 1.35K FOR AC increases gain to 2 x 15k/.15k = 200

They make it sound like by adding this capacitor the resistor will be shorted but I don't see how this could happen.

And that is exactly what happens here. A capacitor is like a short for an AC signal.

For a DC signal it is almost like an infinite-value resistor, so it has almost no effect on the DC signal.

Well a capacitor in this situation acts somewhat like a high pass filter because the ohms of reactance Xc decreases as audio frequency increases.