What does not refer to a noun that comes before it. It acts as a noun+relative pronoun together, and means "the thing that".
What she said made me cry.
I hope you are going to give me what I need
A clause introduced by what can be the subject or the object of a sentence.
You can click here for more information on the subject of relative pronouns