Complex sentence: The treaty came into being after Russia had allied to Prussia on 5 May, making it impossible for Sweden to continue the war which she had entered to regain territories in Pomerania which they had previously lost.
Split into simpler sentences: The treaty came into being after Russia had allied to Prussia on 5 May, making it impossible for Sweden to continue the Pomeranian War. Sweden had entered the war hoping to regain territories in Pomerania which they had previously lost.