Usually which is used to set off a non-restrictive clause preceded with a comma, and that is used only for restrictive clauses.
Non-restrictive Clause
A fire at the Fabulous Cookie Warehouse, which killed seven people, led to safety changes in its reconstruction.
While it is interesting to note seven people died it is not critical to the rest of the sentence. Notice the commas setting off the clause. You can think of a large construction crane lifting the clause out of the sentence without changing its meaning ( A fire at the Fabulous Cookie warehouse led to safety changes in its reconstruction.).
Restrictive Clause
A large company that has government contracts has to carefully maintain personnel files.
That is used as a restrictive element defining or limiting the word it modifies; therefore, it is essential to the meaning of the sentence. No comma is necessary.