The Whig party disintegrated mostly over slavery: the northern Whigs were often anti-slavery and the Southern Whigs were mostly slave owners, therefore they would be pro-slavery.
The Republican party was formed in 1854 by the anti-slavery Whigs, together with other politicians -the same year as when the Whig party was dissolved!
the connection is that the anti-slavery Whig Party members that still wanted to be in politics needed a party to work with - so they participated in the creation of the Republican Party.