While the pronouns which and that have similar uses, the relative clauses they introduce have different relationships with their sentences.
What does that mean?
If the clause includes information that is essential for understanding of the sentence, it is called “restrictive.”
If the clause includes information that’s isn’t necessary for understanding, it is considered “non-restrictive.”
Since non-restrictive clauses can be removed from sentences without creating confusion, they’re offset with punctuation (most often commas).
What does this have to do with which and that?
THAT introduces a restrictive relative clause; WHICH introduces a non-restrictive relative clause.
Look at these two examples:
The chair, which is in the corner, is brown.
The chair that is in the corner is brown.
While both sentences tell us about a brown chair, we can infer more information based on the relative clauses
Since the first sentence uses a non-restrictive clause “which is in the corner” we know the placement of the chair isn’t important; it’s simply extra information. However, in the second sentence, the restrictive clause “that is in the corner” tells us the location of the chair is important.
Rule of thumb: which = extra (with commas); that = important (no commas)
Usage note: to clean up your prose and keep your pace moving, try removing “that” from your sentences. As a relative pronoun it (and the following verb) can usually be omitted without losing readability and meaning:
The chair that is in the corner is brown = the chair in the corner is brown