Other relative pronouns usually refer to a noun that comes before.
- I gave her the money that she needed.
The thing that I’d like most is a home computer.
(That refers to— repeats the meaning of— the money and the thing.)
We use what as [noun + relative pronoun] together.
I gave her what she needed. (What = the money that.)
What I’d like most is a home computer. (What = the thing that.)
- You can have everything (that) you like.
(NOT . . . -everything what you like.)
The only thing that makes me feel better is coffee.
(NOT The only thing what . . .)
We use which, not what, to refer to a whole sentence that comes before.
‘Sally married George,’ which made Paul very unhappy.
(NOT. . . -what made Paul very unhappy.)