Basically you are working with bits.
The ~ inverts the bits of a number
5 = 00000101
~5 = 11111010
The ~5 is -6 because of the form -(N+1):
~5 = -(5+1) = -6 = 11111010
In terms of the left-bit, if you have a left-bit that is a 0 it means that your N is a positive number or 0. If you have a 1 in the left-bit than it means that your N is a negative number.
Ex.:
5 = 00000101 // starts with a 0 -> positive
~5 (-6) = 11111010 // starts with a 1 -> negative