A good way to understand that without too much technical vocabulary is to remember that grammatical words such a "of" and "that" do have a purpose in a sentence; they are not content word, that is, they do not confer the idea of something or someone that is being talked about, but they indicate a relation between content words or between two parts of the sentence. The idea of introducing two such relations at once between two words or two parts is essentially foreign to the world of grammar, or, when that happens because of complexities beyond control, the result can be quite embarrassing for grammarians (this is exceptional, however). An example of that is coordination which is doubled of an apparent subordination suspected to be indicated by the coordinator; in this case the two relations are embodied by a unique grammatical word (and) but the problem is the same.
- Go by air, and save time. (conditional use of "and")
"Of" is a preposition and as all prepositions it must have a complement (always a noun phrase). Similarly "that" is a conjunction of subordination, and it must introduce a clause. So, you can have sentences as the following.
In the second sentence you can use "fact" after "of" because "fact" is a grammatical unit that is proper (a noun), and also because the meaning of "fact" describes what is said by the clause introduced by "that"; finally, you can use "that" after "fact" because "fact" is a word that can be followed by "that" (You check whether that is possible in a dictionary). There are plenty of words with this property: reason, idea ("feelings" only), intention, …
For certain nouns a construction with "that" is not possible (most nouns): joy, freedom, anger, etc.
For others the two possibilities exist: intention, realization, etc. That way you do not have to make an adaptation by the addition of a word above so as to use "that" instead of simply "of" (but you might have to make other adaptations).
- The realization of the necessity of changes was immediate.
- The realization that changes were necessary was immediate.
However, as usual, you can't use both grammatical words together and leave one without the element that goes naturally with it.