How did Peter the Great expand Russia's borders?

He, as the rulers of Prussia and Austria, practically carved out sections of Poland until it was completely dissolved. That is how Russia expanded so much to the west.