When the CSA states left in 1861 the remaining USA states had more than enough votes to end slavery.
The states that had been interfering with that goal weren’t in Congress anymore.
And yet the ruling Republican Party waited until January 1865 to pass the proposed 13th Amendment and it wasn’t ratified until December.
What prevented them from doing this years earlier?
an opinion, Possibly the status of Missouri, Kentucky, Maryland, were part of the consideration in not pushing for the abolition of slavery. By late 1864, it was obvious, to most, that the South was going to lose the war. By that time it made no difference what those border states did, it would not effect the outcome of the war.
And they did eventually.
And yet the ruling Republican Party waited until January 1865 to pass the proposed 13th Amendment and it wasnt ratified until December.
Actually the 13th Amendment passed out of the Senate in the spring of 1864. But it required a two-thirds vote in the House to send it to the states for ratification and there were enough Democrats to prevent that from happening.
What prevented them from doing this years earlier?
Democrats and fighting the ongoing rebellion would be my guess.
Lincoln worried that the border states might rebel if he moved to quickly on emancipation. He believed it was more important to win the war first, then to free the slaves.
Much like the constitutional founding fathers thought it was more important to have all the states remain a part of the Union then it was to get rid of slavery.