The test fails to show equality on (at least) two levels.
First level
\MakeUppercase and \MakeLowercase are instructions to print the uppercased or lowercased versions of their arguments. They don't “directly” transform their arguments.
Second level
\ifx only compares the “surface meaning” of two tokens without any macro expansion. In particular, two macros (every token defined with \def is a macro) are considered equal by \ifx if and only if
- they have the same status with respect to
\long, \outer and \protected;
- their parameter texts are the same;
- their top level expansions are equal.
In your case subtests 1 and 2 pass, but subtest 3 doesn't, because the top level expansions are
\MakeUppercase{1}
and
\MakeLowercase{1}
respectively, which are different sequences of tokens.
A perhaps simpler example is given by
\def\firstX{X}
\def\secondX{X}
\def\testA{\firstX}
\def\testB{\secondX}
The conditional \ifx\firstX\secondX will return true, but \ifx\testA\testB will return false.
Another example: with
\def\first#1{#1}
\def\second#1{#1}
\def\testA{\first{X}}
\def\testB{\second{X}}
the conditional \ifx\testA\testB will return false because the top level expansions of \testA and \testB are different even if ultimately \first{X} and \second{X} will deliver the same result. But TeX doesn't look at the “ultimate” effect when doing \ifx comparisons, just the surface.