SBC is implemented by adding the ones-complement (XOR FF) of the number or register. And the carry flag is backwards compared to other architectures, such as the Z80. On input, Carry Set means that you don't want an additional one subtracted, and Carry Clear means you do want an additional one subtracted. Then on output, Carry Set means that no borrow took place, and Carry Clear means that borrow took place. When borrow takes place, you get an additional one subtracted, and that lets you chain the low bytes up to the high bytes and subtract bigger numbers.
CMP is like SBC, except it always adds the extra one whether your input carry is set or not, making it act like you'd expect comparison to act.