It should be said that from the Chinese point of view the Jin was a barbarian kingdom, not a northern Chinese dynasty as it is often described. The Jin dynasty was founded by the Jurchens, a semi-nomadic people who were the ancestors of the Manchus. The Song Chinese allied with the Jurchens to take down their common enemy, the Khitans from the Liao Kingdom, another nomadic people.
When the Khitans were vanquished the Jurchens turned on the Chinese and carved off northern China. At which point they formed the Jin dynasty. Epic wars followed as Song China fought to reclaim its land. However the Jurchens were fearsome warriors who usually routed the Chinese and Mongols alike. These wars exhausted both the Jin and Song dynasties. Eventually the Chinese came up with a cunning plan, ally with Genghis Khan to take down the Jurchens.
This worked pretty well. The Jin dynasty was unable to deal with war on two fronts and was conquered by Genghis Khan, who died in the effort. His successors initially made peace with the Song dynasty and sought their conquest elsewhere in western Eurasia.
Eventually the Mongols under Mongke Khan, grandson of Genghis, turned their sights on Song China but their invasion failed when Mongke died during a siege. His death would end Mongol adventures in Europe. After a period of disunity, another great leader, Kublai Khan finally managed to overran Song China with a combination land and sea invasion.