B has done something bad that A hadn't ever expected B to do so A is asking B
1- A: Why would you do that? I don't understand.
2- A: Why would have you done that? I don't understand.
What is the difference between these two options?
B has done something bad that A hadn't ever expected B to do so A is asking B
1- A: Why would you do that? I don't understand.
2- A: Why would have you done that? I don't understand.
What is the difference between these two options?
Firstly the second sentence needs rearranging:
Why would you have done that? I don't understand.
The sentence:
Why would you do that? I don't understand.
This sentence asks why B would do something, and sort implies that B would do it again, as though it were a part of who he is. It's much more direct, i.e., directed at B as a person.
Why would you have done that? I don't understand.
This sentence places the emphasis in the past, at the time when B did the thing. It expresses curiosity and a desire to understand with regards to what B was experiencing at that time, and urges B to investigate not so much himself, but what he was experiencing at the time, or what might have influenced him to do such a thing at that time.