According to Garner’s Modern American Usage (3rd Edition), which is possibly responsible for more bad sentences than any other in the language. E. B. White wrote “Careful writers, watchful for small conveniences, go which-hunting, remove the defining whiches, and by so doing improve their work.”
Both that and which can be used to introduce clauses which modify an antecedent noun, pronoun, or verb. Generally speaking such clauses should modify the word, phrase, or clause that immediately precedes them. “The team that scores first wins 75% of the games.” The clause “that scores first” modifies team.
Which and that are often used interchangeably; if you see a which with neither a preposition nor a comma before it, it should probably be that. As a rule, clauses that start with which are non-restrictive and those that begin with that are restrictive. A non-restrictive clause is one that can be removed from a sentence without changing its basic meaning; and a restrictive clause is one which is essential to the meaning of a sentence and cannot be removed.
Non-restrictive: “The car, which is a four-year old Ford, careened out of control.” Remove that clause “. . . which is a four-year old Ford . . .” and the essence of the sentence is not affected. Another: “The building, which was illustrative of Victorian design, burnt to the ground.” Again the clause referring to Victorian design may add color to the sentence, but its removal will not alter its basic meaning.
Restrictive: “All cars that were purchased prior to 2006 must have their airbags replaced.” Remove the clause “that were purchased prior to 2006” from the sentence and it no longer makes sense. Another: “The litigation that involves a lot-line dispute was started by John out of spite.” To know which litigation is being identified, it is essential to have the clause “that involves a lot-line dispute” in the sentence.
One final note, who can be used to introduce such clauses, but it can only refer to a person. “The boy who was generally late to class did poorly in the exam.” For reasons unknown to me, if the clause is restrictive, that may be substituted for who; but where the clause is non-restrictive (The boy who loves ice cream, arrived at school at 8:00 am.), which is never substituted for who.
– Ken Butera