If you were to replace 'that' with 'where' the sentence would have a different meaning, which would be that delusion is about where, i.e in what physical location, students are implicitly learning grammar.
In 2) 'where' is being used in the sense of where a thing happens, in this case in a relationship, as in the phrase 'in the case where (such and such a thing happens)'. Not a physical where, a location, but an example of something occuring. You couldn't use 'that' here without changing the sentence, e.g 'something she said that she liked about the relationship is that....' referring to a particular thing about a particular relationship, rather than citing a general example of a good relationship. In general 'that' is specific, where here is more general.