Peter defeated the Swedes by doing a deal with the Baltic German barons, who switched sides to get rid of the Swedes because of all the public schools they had established to teach Latvian peasants to read. The Baltdeutsche Grafen didn't want literate serfs. Again, a Russian victory was made possible by alliance with a powerful western ally. After that most of the Tsars' foreign ministers were Baltdeutsche Grafen. Modris Eksteins, the prize-winning Canadian Latvian author of Walking Since Daybreak: A Story of Eastern Europe, WWII and the Heart of our Century, begins his book with the story of how his great grandma Greta got knocked up by a Baltic German baron. So the Latvians getting screwed by the Russians also involved getting fucked by the Germans, literally as well as metaphorically.