Let's say I have provided an answer to some question, and then another user comes and provides a comment which looks something like:

"you should also add to your answer that X can often lead to Y"

And let's say I think it's a very useful comment, and I'm not really sure I need to add anything belong that "X can often lead to Y" part. Should I edit my answer to incorporate the comment, or should I just upvote it? The former makes my answer more complete, the latter makes sure credit is rightfully given to the commentator, which would have otherwise probably deleted her comment.

I also could incorporate it into my answer and credit the user by name. As Grace Note noted gracefully

The answer is more important than who gets credit, IMO. If you feel that what the commenter suggests would really improve your answer, I'd say update it (unless the accepted answer already covers the same material -- no point in duplicating an existing answer). Mark it as an edit to distinguish it as later material to avoid confusion if the comments are left intact. I usually try to indicate that it was added due to the comments. I hadn't really thought about having to credit the addition because I assumed that the comment would still be there. Maybe I'll have to change my behavior in that respect and change my attribution to something like EDIT: based on @Oak's comment.