Quasistatic Expansion

I want to make sure that my mental picture of quasistatic expansion is correct. A lot about what I've read is that it needs to be slow so that the internal pressure/temperatures are well-defined. But I'm perhaps confused on what this implies about the external pressure and why the work the piston does on the gas is calculated using the expression of the internal pressure of the gas.

Imagine we have a cylinder with a movable piston. The pressure of the gas inside the cylinder is 2 atm. The pressure of the external surroundings is 1 atm.

In the assumption of quasistatic expansion, are we imposing that P_ext at the surface of the piston = P_internal = NkT/V at all times --- so that the net force on the piston is zero and it moves at a constant (slow) velocity? In other words, are we assuming that the piston encounters a pressure gradient (going as 1/V) as it moves out? This is what the grain-by-grain sand analogy seems to suggest, am I thinking of that correctly?

Is this an OK assumption in practice because most real-world applications have pressure gradients and not step functions in pressure?

Thanks so much for your help!