The main difference between "that" and "which" lies in their usage as relative pronouns, which are words used to introduce relative clauses in sentences. These relative clauses provide additional information about a noun in the sentence. Here's how they differ:
That:
Restrictive or defining relative clause: "That" is used in restrictive clauses, which are essential to the sentence's meaning. These clauses provide necessary information and cannot be removed without changing the meaning of the sentence.
Example: "The book that is on the table is mine." In this sentence, the clause "that is on the table" is essential to identify which book is being referred to. Removing it would make the sentence unclear.
Which:
Non-restrictive or non-defining relative clause: "Which" is used in non-restrictive clauses, which provide additional, non-essential information about a noun. These clauses are separated by commas and can be omitted without changing the sentence's core meaning.
Example: "The book, which is red, is mine." In this sentence, the clause "which is red" provides extra information about the book but is not necessary to identify which book is being referred to. You could remove it, and the sentence would still make sense: "The book is mine."
In summary, "that" is used for essential information that cannot be omitted, while "which" is used for non-essential information that can be omitted without altering the core meaning of the sentence. The choice between them depends on whether the relative clause is restrictive or non-restrictive.