After the death of Louis of Hungary in 1382, king of Hungary and king of Poland, in 1384 his daughter Jadwiga Andegawenska, great-granddaughter of Polish king Ladislaus I the Short, inherited the Polish throne.
She had to choose a husband, who became Ladislaus Jagiello, Grand Duke of Lithuania. According to modern laws, it was a paedophile relationship, because Jadwiga at the first meeting with Jogaila was 13 years old at the most, and she was more than 20 years younger than Jogaila. However, this age difference did not prevent them from having a consensual relationship later on. It was also a well-matched political marriage, in which Lithuania and Poland were united by a personal union, later called the Republic.
The union had a common enemy, the Teutonic Order, which had previously come to Mazovia on a mission of a knightly order, that is to defend against attack, "to defend those who cannot defend themselves".
Invited by Conrad of Mazovia to Mazovia in 1226 as a defense against the Prussians inhabiting the northern territories, settled on the Dobrzyń land on a fief principle, the Order, acting on the principle that the best defense is the attack, conquered the Prusai lands under the banner of Christianization, and then, as already liberated the Prussians from their paganism, strengthened this liberation by establishing its own state on liberated territories. And when he already had a state, he came up with an idea to liberate also the neighboring countries and so it came to the liberation of Lithuania. Although Mindaugas, Grand Duke of Lithuania in 1251 accepted baptism (the condition of coronation), later Christianity did not really take hold in Lithuania, and only Wladyslaw Jagiello as Grand Duke of Lithuania in 1385 (the union in Krevo) decided to introduce baptism in Lithuania as a common thing. Plus the wedding with Jadwiga plus the throne of Poland, that's obvious.
From then on, the liberation of Lithuania under the banner of Christianization was already impossible, in fact there was nobody to liberate and the Teutonic mission was theoretically finished. But the Order did not have the slightest intention to leave after the mission was finished, even did not want to return the Dobrzyn lands, which after all were never given to the Order, but only leased for the time of the mission. What is more, the Order from time to time was pushing, uninvited, on the neighboring territories, entering into parades with neighboring countries, and even going as far as fighting with those countries.
King Ladislaus and Queen Jadwiga first of all dealt with putting in order matters in Polish and Lithuanian state. Poland was quite neglected, because during the reign of Louis he stayed mainly in Hungary, in Lithuania matters were also disordered. In addition, the water was disturbed by the Order, for which the Polish-Lithuanian union was a threat. At last it came to a formal war with the Order. And to the battle of Grunwald.
The Battle of Grunwald on July 15, 1410 between Teutonic Order and Polish and Lithuanian army was one of the biggest battles in Europe and certainly one of the most famous, because on the Teutonic Order side besides its own forces there participated knights from Western Europe, while on the Polish and Lithuanian side (united by personal union in the person of Polish king Ladislaus Jagiello) there participated also knights from other countries, like neighbouring Bohemia or even troops sent by Khan of the Golden Horde. The news about the battle spread around the whole medieval world at that time. Poland and Lithuania united with it gained great fame and respect in the world and the bravery of the Polish knights found recognition among the knights of Europe and Asia.
Since then, Poland appeared as a European military power, and the Polish throne became a sweet treat for royalty and aristocracy of Europe. However, the throne was hereditary and after a long reign of Ladislaus Jagiello, in 1434 the throne of Poland was taken by his older son Ladislaus Jagiello, his namesake, who reigned as Ladislaus III, later called Varnañczyk, because he died in the Battle of Varna during a battle against the Ottoman Empire. After Varna's death his younger brother Casimir took the throne in 1447 (when Casimir was born his father Ladislaus Jagiello was 76 years old and his second wife Sophia Holszanska was 28 years old). Casimir's reign, with the active attitude of his wife Queen Elizabeth, led to the expansion of Poland's territory, also through family ties and personal unions, to a considerable size, creating access to three seas, as shown on the map below.
Casimir Jagiellonian married in 1454 Elisabeth Rakuszanka, which is a spelling of her family name Habsburg. Queen Elisabeth and King Casimir had 13 children together, including 7 daughters and 6 sons. Two daughters, both named Elisabeth, died in childhood, Elisabeth married Prince George the Rich of Bavaria, of the Wittelsbach family (whose wedding was so lavish that it is celebrated as a festival in Bavaria to this day), Anne married Boguslaw X, Duke of Pomerania, Barbara married Prince George the Bearded of Saxony, Elisabeth (the third Elisabeth) married Frederick II, Duke of Legnica. Sophia married the Elector of Brandenburg Frederick Hohenzollern, and their son Albrecht became the Master of the Teutonic Order.
One of the six princes, Casimir, who was planned to be the heir to the throne, unfortunately died of tuberculosis at the age of 25. Frederick became bishop of Cracow, cardinal, archbishop of Gniezno, primate of Poland. Ladislaus became king of Hungary and Bohemia. Jan Olbracht became king of Poland. Alexander became king of Poland and Grand Duke of Lithuania. Sigismund became king of Poland and Grand Duke of Lithuania. Four of his sons became kings.
In 1525, the master of the Teutonic Order, Albrecht, grandson of Rakushanka, pays homage to his uncle, King of Poland, Sigismund I, son of Rakushanka. Queen Elizabeth, Albrecht's grandmother and Sigismund's mother, would have to be pleased to see the Commonwealth and the Teutonic Order, until recently fierce enemies, enjoying themselves peacefully at a family party.
(Translated with www.DeepL.com/Translator)