Where does this expression "what gives" come from? Especially when used as "what's happening?"
I would think it's rather probable that it is a calque derived from the perfectly idiomatic German phrase "Was gibt's?". You see? "Was gibt's" <-> "What gives" Pretty close. Don't know why the author of the linked source (Brian Joseph) doesn't see this and only considers "Was gibt es?" which you will rarely hear in colloquial speech.
Instead the e in 'es' is mostly dropped, hence: "Was gibts?"
Although the meaning has deviated a bit apparently. In German it can only mean ~ "what's happening?" / "what do you want (from me)?"
The etymology is unknown; it is from at least 1940 in American English, and may have come from a calque in German, but there's not much evidence for this. In any case, it's covered in detail by Brian Joseph's What Gives with What Gives?. Here's an excerpt:
The construction seems clearly to have originated in American English; the first attestation for what gives comes in 1940, in John O'Hara's Pal Joey, according to Wentworth and Flexner (1960: 574, s.v. what gives) and the Oxford English Dictionary (1989 on-line second edition).