Of many sons of Olgerdas, after his death (1377) Jogaila became his heir. Lacking the gifts and the nobility of his father, Jogaila compensated them with treacherousness. Together with Germans, he plotted against his uncle, Kestutis. Kestutis dethroned Jogaila, but spared his life. Finally, Jogaila started another revolt, treacherously captured Kestutis and ordered to strangulate him (1382). Kestutis' son, Vytautas, escaped from the jail and fled to the Teutonic knights. Soon her returned to Lithuania, made peace with Jogaila and even managed to get some of his father's lands back.
In 1385, Polish government offered Jogaila to marry the Polish princess Jadwiga. The Poles had good reasons for that. After the House of Piasts ended in 1370, the Polish crown went to the king of Hungary Louis I, and after his death in 1382 his little daughter Jadwiga inherited the throne. The Polish szlachta decided that Jogaila might be a good husband for their queen. First, Lithuania and Poland competed for the Russian provinces of Volyn and Galich. Lithuania adjoined Volyn and threatened to take Galich. This threat could be quelled by the marriage of Jogaila and Jadwiga. Second, the Germans who captured the Lithuanian shores of the Baltic sea, also took the Polish Pomorze (Pomerania) and controlled the trade along Vistula. The joint forces of Poland and Lithuanian could be more successful in the resistance to the Germans.
The proposal was happily accepted by Jogaila. The Poles required that he converts to Catholicism himself and converts Lithuania. Jogaila also agreed to unite the two countries into one state and to oppose the German threat. In 1386, Jogaila and Jadwiga married. The Lithuanians were baptised, the pagan sanctuaries were burnt. Jogaila helped the Poland to return the cities of Red Rus (Red Ruthenia), occupied by Hungarians: Galich, Lviv and others. At last, the
joint forces of the Western Russia, Lithuania and Poland joint Lithuanian-Russian and Polish forces completely defeated the Teutonic order in 1410 on the border of Poland and Prussia, near the villages Grünwald and Tannenberg. The power of the Teutonic order was blown up and the importance of the united Poland and Lithuania grew immensely.
So, the goals of the union were achieved. The hostility between Lithuania and Poland was over, and their common enemy was destroyed. For Poland, the union was a success. Not so for Lithuania. Till 1386, there were two peoples (Rus and Lithuanians) and two religions (orthodox christianity and paganism) in Lithuania. The orthodox Russians accounted for about 90% of the whole population and represented a higher culture than the pagan Lithuanians, who were heavily influenced by the Russian culture. The union of 1386 made the Catholicism the religion of the ruling class and made the two branches of Christianity oppose each other. The Orthodox population was more numerous, but the Catholicism became the dominant religion, since it was the faith of the knyaz and his court. This brought the religious enmity to Lithuania. Polish clerics and officials replaced the Russian retinue of the knyaz and brought Polish culture and Latin language. The majority of the population of Lithuania and the Western Russia didn't accept the new traditions and opposed Jogaila.