"President Johnson made clear his opposition to the 14th Amendment as it made its way through the ratification process, but Congressional elections in late 1866 gave Republicans veto-proof majorities in both the House and Senate.
Southern states also resisted, but Congress required them to ratify the 13th and 14th Amendments as a condition of regaining representation in Congress, and the ongoing presence of the Union Army in the former Confederate states ensured their compliance."
https://www.history.com/topics/black-history/fourteenth-amendment