That and Which
Relative clauses with which or that usually modify nouns. The end result is that the original noun becomes one big Noun Phrase and functions just like a large noun.
- Do you remember the volcano [which erupted whilst we were on holiday]?
Here we see the noun volcano being modified by which ... holiday. The whole Noun Phrase the volcano which erupted whilst we were on holiday has the function of Direct Object of the verb remember.
Notice that it is the word which that is the subject of which erupted whilst we were on holiday - not the word volcano. Rather, the word volcano is the antecedent for the pronoun which. This means that we interpret which within the clause through the word volcano which comes before it. In normal relative clauses, the pronoun which always has an antecedent. The relative word that, also appears in clauses in front of which there is some kind of noun as an antecedent:
- Do you remember the volcano [that erupted whilst we were on holiday]?
So in both of these types of relatives clause we have an antecedent noun, which helps us interpret another element in the embedded relative clause.
If we compare the following sentences we''ll see that there's a very specific difference in relative clauses with what:
- The things that she did were thoughtful and useful.
- The things which she did were thoughtful and useful.
- What she did was thoughtful and useful.
- I liked the thing(s) which she did.
- I liked the thing(s) that she did.
- I liked what she did.
The big difference is that, as you can see, there's no antecedent noun for the relative clauses with what. The relative clauses with which/that all have the things as an antecedent. What takes the place of both the antecedent as well as the relative word.
With regard to the Original Poster's examples:
- 1) He will do anything _ is needed.
Here we see that there is an antecedent noun phrase, anything. Therefore we need to use that or which:
- He'll do anything that's needed.
[However, if we removed the noun phrase anything completely, then we could use what:
- 2) They always ignore _ is so obvious.
Here there is no antecedent noun so we have to use what:
- They always ignore what's so obvious.
- 3) All _ I have is yours.
Here we find an antecedent noun, the pronoun all. We cannot therefore use what, but must use that instead. We could use which but when the antecedent is a pronoun like this it is often better to use that.
- All that I have is yours.
Regarding the Original Poster's last unnumbered example, consider the following:
I know what I think.
I know that I think.
The first sentence has a relative clause, what I think as a direct object. Within the relative clause itself, the object of think is understood as the item what.
The second sentence however does not have a relative clause. We know this is the case because there is no antecedent for that. The clause following know is a declarative content clause. The sentence has the same structure as I know that Yetis exist or I know that you like cheese.
In the second example,the clause that I think is the complement of the verb know. The verb think here has no object. The word that is a marker showing that the following clause is subordinate. In fact we can remove that entirely from the sentence and it will still be grammatical and still have the same meaning:
- I know I think. Or at least I believe I do.
To sum up, if there is an antecedent noun in the main clause then that or which appears at the front of the relative clause. We find what when there is no antecedent.
Hope this is helpful!