How are relative pronouns pronouns?

Pronouns usually replace nouns or noun phrases. There are a few fuzzy examples where it's not as clear cut as that (e.g. "my" which refers to me but acts like a determiner, and "mine" which refers to both me and something else).

How are relative pronouns like that and which pronouns? What noun or noun phrase do they replace? If they're not strictly speaking pronouns, what would be a better description for them?

Examples from Wiktionary:

  • The CPR course that she took really came in handy.
  • The house that he lived in was old and dilapidated.
  • We've met some problems which are very difficult to handle.

I'm not talking about other clearly pronominal uses such as:

  • Which is which?
  • That is that!

It's a fairly common viewpoint that the "that" used to introduce relative clauses is not in fact a pronoun.

Which is like a pronoun in the following way. Just as they in the pair of sentences "We've met some problems. They are very difficult to handle" can be seen as replacing a noun phrase like "those problems", the word which in "We've met some problems which are very difficult to handle" can be seen as standing for a noun phrase like "those problems". Of course, you couldn't use the actual noun phrase "those problems" in the same position, but the pronoun which is understood to mean something along those lines.