The difference between defining and non-defining relative clauses
A defining relative clause identifies or classifies a noun:
Do you know the guy who is talking to Will over there?
I wrote my essay on a photo which was taken by Robert Capa.
If we omit this type of clause, the sentence does not make sense or has a different meaning:
Do you know the guy? (which guy?)
I wrote my essay on a photo. (what kind of photo?)
A non-defining relative clause adds extra information about a noun which already has a clear reference:
The Mona Lisa was painted by Leonardo da Vinci, who was also a prolific engineer and inventor.
If we leave out this type of clause, the sentence still makes sense:
The Mona Lisa was painted by Leonardo da Vinci. (we know who Leonardo da Vinci was)
Sometimes, the use of commas marks a difference in meaning:
The athletes who failed the drug test were disqualified. (defining)
The athletes, who failed the drug test, were disqualified. (non-defining)
The defining relative clause tells us that only those athletes who failed the drug test were disqualified. The sentence implies that there were other athletes who did not fail the drug test and that they were not disqualified.
The non-defining relative clause tells us that all the athletes (mentioned earlier in the context) failed the drug test and that all of them were disqualified.