Her Wikipedia article includes this, "She came to Poland at the age of five years as a lady in waiting to Marie Louise Gonzaga, the French-born Queen of Poland from 1645 to 1672, wife and consort to two Polish kings — Władysław IV Vasa and later his brother (who succeeded him) John II Casimir Vasa. At the court she met John Sobieski, who arrived there in 1656, but she was first married to Jan "Sobiepan" Zamoyski in 1658, with whom she had three daughters, all died in infancy. Zamoyski died in 1665 and the widowed Marie Casimire eventually married Sobieski on the 14 July the same year. The couple had fourteen children together, but only four of them survived until adult age — Jakub, Aleksander, Konstanty and Teresa (who later became Kurfürstin of Bavaria and mother to Emperor Karl VII).
John Sobieski was elected King of Poland in 1672, not without the influence of his wife. As the Queen of Poland, Marie Casimire supported the proposed Polish–French alliance, while at the same time striving to gain privileges for her family from the French king Louis XIV."
This is an example of being at the right place at the right time and taking advantage of opportunity.