Why is #pragma considered a preprocessor directive?
Because the C standard says so. It is specified in the chapter preprocessing directives, C17 6.10.6. Other than that, the standard is intentionally very vague with what #pragma
should do, since the whole purpose is to do something compiler-specific. Or in case the pragma isn't recognized - ignore it.
How a certain compiler handles the contents of a pragma internally isn't specified.
Some pragmas obviously need to be pre-processed, notably the kind that enables/disables certain compiler behavior like #pragma warning ...
etc. Lots of them must be evaluated during pre-processing or the compiler won't know how to compile the code.
Does preprocessor really do something with #pragma?
Yes, it evaluates it in translation phase 4: "Preprocessing directives are executed, macro invocations are expanded, and _Pragma unary operator expressions are executed."
Please note that having a pre-processor separated from the compiler is mostly a theoretical model. In reality the pre-processor and compiler are often rather tightly integrated with each other.