In this case you have restrictive (or defining) and non-restrictive (non-defining) relative clauses. Non-restrictive clauses use commas; restrictive clauses do not use commas. Non-restrictive relative clauses give extra information about the noun they are describing; restrictive clauses give us defining information about the noun being described.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.