Newcomen's steam engine had the basic flaw of condensing steam to water inside the piston chamber which made the steam engine inefficient. James Watt used a condenser separate from the piston cylinder, where steam would be cooled to create a vacuum to move the cylinder. This separation of condenser and cylinder increased the efficiency of the engine by eliminating the need for repeated heating and cooling of the cylinder.
Steam enters the cylinder forcing it up - upstroke - and exits into the condenser on the downstroke, creating a partial vacuum and drawing the piston down - downstroke.