Placed differently in a sentence, the comma can change the meaning. Look at the following example:

Les élèves, qui avaient oublié leurs livres, ont été punis. (All the students forgot their books and all were punished.)
Les élèves qui avaient oublié leurs livres ont été punis. (Only the students who forgot their books are punished, the others had them with them.)

The comma is directly attached to the last word and then a space introduces the new word.