Think of é as the “it” in the more literal translation “What is it that is happening here?”.
This always confuses me. A lot of questions can be phrased "What is it that is..." in English. But only some seem to call for atá in Irish.
The atá is needed when a copula wouldn’t suffice to express the question, such as when an English present progressive verb needs to be translated.
It seems it can be either cad or cad é with a direct relative clause. Both Cad a dhéanann tú and Cad é a dhéanann tú seems acceptable.
Without atá, only a copular question (i.e. an identificational question or a classificational question) could be asked using cad.
I said "what is it that's happening here?" and it was deemed incorrect. Then why the "e"???
What is the function of E in this sentence? Why is " What is it that's happening here?" incorrect? Wouldn't " Cad ata ag tarlu anseo?" Be "What is happening here?"
"What is it that's happening here?" isn't incorrect, but it is unnecessarily wordy.
The presence or otherwise of the é is probably a dialect thing - some dialects would include it, some wouldn't.
For example, the NEID gives 4 different suggestions for "What's Up?"("What's the matter?") with céard, cad and cad é examples:
céard atá ort?
cad atá cearr?
cad é atá contráilte?
cad é atá ag cur as duit?