Meaning/Usage: Used to ask what is the matter or what went wrong
Explanation: The only explanation I found was that this could have come from German borrowing. Germans used the phrase "was gibt es?" as "What is the matter?" or "What's up?" But to be honest. I am not sure about this. However, I do know that in English, it is commonly used to ask "What is the matter?"
It's not like you to get so upset, what gives?
I had no idea you were leaving? What gives?
Your mom said you stopped taking piano lessons. What gives?
A.
I heard that you did not pass your test?
B.
Yeah, it was harder than I thought.
A.
You studied really hard for it though, what gives?