The Great Northern War, fought from 1700-1721, gets its name from the fact the war focused on the Baltic, but the battlefields extended into Germany and deep into Poland and Ukraine. Sweden was a military power with a small empire in the Baltic, while Russia was still a landlocked place, backward when compared to the rest of Europe, not very powerful, and highly xenophobic. The Poland-Lithuanian Commonwealth was still powerful, and the Cossacks were still free. Moreover, despite the fact the Ottoman Empire was weakened, it held sway in the Balkans and deep into Eastern Europe, and the Krim Tatars were still raiding into Ukraine, Russia, and Poland for slaves. The Great Northern War would involve the Ottomans and the Tatars as well.
Given the length of the conflict, perhaps it’s not surprising that other Western European kingdoms ended up in the mix. Brandenburg-Prussia was involved in the later phases of the war - Frederick William was an elector of Brandenburg and had just been granted the right (by the Holy Roman Emperor) to call himself king in Prussia. He held both titles, but there was still a formal separation between Brandenburg and Prussia. Frederick William was strongly interested in acquiring some or all of Pomerania, a region on the Baltic coast, particularly in acquiring a port, which would eliminate paying Swedish tolls in Swedish-controlled ports.
Ultimately, the most important aspect of the war is that it laid the foundations for the Russian Empire. By 1718, the Russians had conquered most of Finland, the port of Riga, and the Swedish city of Vyborg. These gains in the Baltic Sea strengthened the burgeoning Russian Empire and provided ports and access to the rich resources of Finland, including valuable meat and lumber. Peter also proved to be a rather benevolent conqueror, allowing these regions to maintain both their faith and culture.