Here, why do we assume the gas pressure to be same as the external pressure everytime in during the process of expansion?
In a reversible process, the pressure of the gas is uniform throughout, and the force per unit area that the gas is exerting on the piston face is equal to its pressure, as determined from its equation of state. So the work is equal to the force integrated over the displacement, or, equivalently, the uniform gas pressure integrated over change in volume.
In an irreversible process, the pressure of the gas is not uniform throughout, but, at the piston face, the force per unit area that the gas exerts on the piston face must match the force per unit area that the piston face exerts on the gas, by Newton's third law. But, in this case, because the gas pressure is not uniform throughout (and also because viscous stresses contribute to the force per unit area of the piston), the force per unit area at the piston face cannot be determined from the equation of state. However, if the force per unit area at the piston face is imposed by specifying external conditions on the system, the work that the gas does can still be calculated as the integral of the external pressure integrated over the volume change.
So, to summarize, in both reversible and irreversible processes, the force per unit area exerted by the gas on the piston face is equal to the externally applied pressure and the work is equal to the external pressure integrated over the volume change. However, in the case of a reversible process, the uniform gas pressure can be determined from the equation of state of the gas, but, for an irreversible process, it cannot (and needs to be determined by controlling the external pressure in some way).
According to me it we do not assume the gas pressure always equal to external pressure in an irreversible process.We select external pressure for calculating the work done because it is the only pressure against which gas had done work by creating a small change in volume until both the internal as well as external pressure becomes equal.