Here's why:
* As a pronoun: "What" is usually used as a pronoun to refer to something that is unknown or unspecified. For example: "What did you say?" "What is your favorite color?"
* As an adjective: In certain situations, "what" can function as an adjective to modify a noun. This happens when "what" means "of what kind" or "of what nature."
Here are some examples of "what" as an adjective:
* What kind of cake do you want? ("What" modifies "kind" which describes the "cake")
* He didn't know what time it was. ("What" modifies "time" to describe the time)
* I don't understand what happened. ("What" modifies "happened" to describe the event)
It's important to consider the context of the sentence to determine whether "what" is functioning as an adjective or a pronoun.