Once you understand que, qui is relatively easy.
Remember that que represents a direct object in a sentence.
Well, qui represents a subject.
Without the qui, you could imagine the same thing being communicated as follows:
You may have got used to using to refer to a person:
But as a pronom relatif, it can refer to whatever a subject can (because it is a subject).