You have jumped to a conclusion in asking about whether the comparison is based on values or bit patterns, because there is an important step first. Before comparison, the operands of == are converted to a common type.
As an example, when you compare a 32-bit two’s complement int x with the bit pattern 1000…00002 (representing −2,147,483,648) and an unsigned int y with the same bit pattern (representing +2,147,483,648) with x == y, the x is first converted to unsigned int, which produces +2,147,483,648. Then +2,147,483,648 is compared to +2,147,483,648, so == reports they are equal.
C 2018 6.5.9 (“Equality operators”) 4 says:
If both of the operands have arithmetic type, the usual arithmetic conversions are performed…
The usual arithmetic conversions are specified in 6.3.1.8. Paragraph 1 starts:
Many operators that expect operands of arithmetic type cause conversions and yield result types in a similar way. The purpose is to determine a common real type for the operands and result. For the specified operands, each operand is converted… to a type whose corresponding real type is the common real type.
The rules involve some technical details, but, in large part, when you compare two integer types, first each will be promoted to at least int, and then the narrower type will be converted to the wider type. If they are the same width but one is unsigned, the signed type will be converted to the unsigned type. This may change the value.
Once the actual values to be compared are determined, the result of == is defined in terms of the values, not the bit pattern.
(The most common situation where these differ is with floating-point +0 and −0, which represent the same real number and compare equal but have different representations. In most modern environments, all bit patterns in an integer type represent different values, and all bit patterns in a binary floating-point type represent either different values or NaNs except for +0 and −0. There are some less commonly used floating-point types that have multiple representations for some values, analogous to the way 3.5•107 and 35•106 represent the same number.)
Anytime you compare a negative value in a signed integer type to an unsigned type that is the same width or wider (after the promotions), the value of the signed type will be changed before the comparison. So you have a risk of getting a “mathematically wrong” result.