Originally Posted by Furienna
If I'm not completely mistaken, Sofia of Sweden (Victoria's grandmother) belonged to the house of Oldenburg, because the house of Vasa was already extinct by her time. But her family did have some ancestry from that house, which is why her brother Gustav would call himself "prince of Vasa" (which was really annoying to Carl XIV Johan, who was the first king of the Bernadotte line).
Furienna, you're mixing up two Swedish princesses called Sofia.
(1547-1611) was the daughter of Gustav I and Margareta Leijonhufvud and married Duke Magnus II of Sachsen-Lauenburg.
The second Sofia
who was born in 1801 and died in 1865 was as you mentioned a daughter of Gustav IV Adolf and Fredrika of Baden and married her grandfathers half brother Leopold of Baden to unite the older and the younger branches of the House of Zähringen. Their daughter Victoria later married the future Gustav V of Sweden.
The later Sofia belonged to the House of Holstein-Gottorp which was a branch of the House of Oldenburg.
Funnily enough the Swedish branch of the House of Holstein-Gottorp didn't have the main claim to the throne when Adolf Fredrik was elected king. Instead it belonged to his cousin Paul who instead was chosen by his aunt Elisabeth to follow her on the Russian throne. He later married a German princess called Catherine of Anhalt-Zerbst and the rest as they say is history