Here's why:
* Restrictive phrases/clauses are essential to the meaning of the sentence. They limit or specify the noun they modify, and removing them would change the meaning of the sentence.
* Nonrestrictive phrases/clauses are extra information that can be removed without affecting the sentence's core meaning.
Examples:
* Restrictive: "The book that I borrowed from the library is overdue." (Removing "that I borrowed from the library" changes the meaning; it's not just any book.)
* Nonrestrictive: "The book, which I borrowed from the library, is overdue." (Removing "which I borrowed from the library" doesn't change the core meaning; we already know which book is overdue.)
Commas are used to enclose nonrestrictive phrases and clauses, not restrictive ones.