As the alveoli increase in size, the surfactant becomes more spread out over the surface of the liquid.  This increases surface tension effectively slowing the rate of expansion of the alveoli.  This also helps all alveoli in the lungs expand at the same rate, as one that expands more quickly will experience a large rise in surface tension slowing its rate of expansion.  It also means the rate of shrinking is more regular as if one reduces in size more quickly the surface tension will reduce more, so other alveoli can contract more easily than it can. Surfactant reduces surface tension more readily when the alveoli are smaller because the surfactant is more concentrated.