The historical portion of this article is misleading and relies on Western people’s lack knowledge of the region. It makes you think that Sweden then was Sweden today, a neutral peaceful country. In reality, Sweden had spent the previous century invading and destroying Central and Eastern Europe. It was so destructive that some historians estimate the damage in Poland exceeded that of World War 2.
https://en.m.wikipedia.org/wiki/Deluge_(history)
Peter the Great indeed did “take back” the land from Sweden, which Sweden had conquered from Russia about a century beforehand.
Nyenschantz was built in 1611 to establish Swedish rule in Ingria, which had been annexed from the Tsardom of Russia during the Time of Troubles.
https://en.wikipedia.org/wiki/Nyenschantz