First of all,
you should write where have you found this question.
Anyway:
when you are using setHeader you are deleting the old contents of the header, and you are puting into it a new value.
when you are using addHeader you are NOT deleting old contents, you just add a new value to this header.