There are two basic types of subordinate (dependent) clauses in English. A clause is called non-restrictive if it adds only parenthetical (that is, additional, non-essential) information to the sentence. For example,
The sentence tells us that “Edgar Allan Poe was an American writer and poet. Oh, by the way, he also wrote The Raven.” Non-restrictive clauses are always separated from the rest of the sentence by commas or parentheses.
A clause is called restrictive if it contains essential information; if it cannot be removed from the sentence without “damaging” its structure. For instance,
Here, if the clause “who wrote The Raven” were omitted, we would have no idea who the poet was supposed to be. “The poet who wrote The Raven” acts as a single unit synonymous with “Edgar Allan Poe”.
Essential clauses provide context without which the whole sentence would fail to communicate its intended meaning, and, consequently, we (almost) never use commas or parentheses to separate them from the rest of the sentence.
‘That’ always introduces a restrictive clause
In modern English usage, “that” always introduces a restrictive clause (due to which it is almost never set off by commas):
In the first sentence, the subordinate clause specifies which box we are talking about, so using “that” without commas was appropriate. In the latter example, “that” was inappropriately used to introduce a parenthetical (non-restrictive) clause.
Restrictive ‘which’ – a transatlantic divide
In British English, it is absolutely fine to use “which” in restrictive as well as non-restrictive clauses:
There is a widely accepted prescriptive rule in the US that states that “which” is to be used only in non-restrictive clauses (such as the second one above). The first sentence above is usually perceived as incorrect in formal American English.
There are several issues with this rule. First of all, it is a prescriptivist rule, and most Americans don’t strictly follow it in speech (many being unaware of its existence altogether). Secondly, when “which” is combined with a preposition, noun, or a pronoun, it cannot be replaced by “that”, even when it introduces a restrictive clause (this is considered to be an exception to the rule), as in
So, should you follow the rule or not? If you write for an American audience and don’t follow the rule, you run the risk of sounding uneducated to some of your readers, so it is better to follow it. If you write for a British audience, you can ignore it completely, but if you do follow it, it will not make your written English look less natural.