First, let me quickly explain the American political model during the 19th century. At that time, the right-wing/left-wing divide was largely a North vs. South issue.
On the right-wing were the New Englanders, who wanted more power for the Federal government, big business, and high tariffs. Their party was called, at different times, the Federalists, Whigs, Know Nothings, and Republicans.
On the left-wing were the Southerners, who wanted more states’ rights, suffrage for white peasants and low tariffs. Their party was known as, at different times, the Anti-Federalists, Democratic-Republicans, and Democrats.
Both parties had a racist agenda, but that agenda was only against their own local minorities. In the North, the minorities were the Catholics and immigrants. The Republicans were violently racist against them. In the South, the minorities were the blacks, and the Democrats obviously enslaved them.
Just as importantly, both sides courted the other side’s minorities. The Republicans were the party that supported Southern blacks, and the Democrats were the party of the North’s Catholics and immigrants.
Taking race out of it, the political divide between the South and North was a legitimate, left-wing vs. right-wing debate about states’ rights vs. the power of the Federal government, and one which was on-going throughout the 19th century.
So no, Lincoln was not a left-wing liberal. He was a right-wing conservative. Race was simply highly politicized within that debate.
So how did the American left-wing end up being the defender of blacks? Well, the American left-wing has always been the defender of the “little guy”, but the definition of who the little guy is has expanded over time.
With Thomas Jefferson, the “little guy” was the white landholder (vs. the Federal government), which is why he argued vigorously for states’ rights.
With Andrew Jackson, the definition of the “little guy” was expanded to mean any white man, rich or poor, which is why is he supported universal suffrage for all white men.
With William Jennings Bryan (who was the Democratic nominee for president three times during their longest losing streak), the rights of the poor white man (the worker) were expanded to include the right to unionize and work an 8 hour day. This brought the unions into the Democratic party.
Under FDR, the poor white man’s rights were expanded to include safety from economic depressions. Since the nation’s founding, there have been eight depressions in America (1807,1815,1837,1857,1873,1893,1920,1929). With the complete collapse of the banking system in 1929, laissez-faire capitalism was largely seen to have spectacularly failed. FDR promised a New Deal, where, under a new economic system (now referred to more generally as “Keynesian economics”), there would be no more depressions. More than 75 years later, we see that there hasn’t been another depression since.
And under LBJ, the definition of the “little guy” was expanded to allow for African-Americans as well. Only then, did the Democrats become their party. However, I notice that the Know Nothing Republicans still have a problem with immigrants. (See their idiotic push against the H-1B Visa, a program which basically allows the world’s future innovators to immigrate to America.)