I know some people no longer care ... but think it has to do with the noun that the pronoun is replacing being either the object or the subject of the verb, if its subjct = which, if it's object = that, i.e.
I have a car which is kept in the garage (car is subject of kept)
I have a car that I keep in the garage
(car is object I is the subject)
it's a long time since I did any grammar though so could be hopelessly wrong. I think it's kind of like the difference between the use of 'qui' (which) and 'que' (that) in french.