Hello, JohnDR! It's a hard question, although maybe there's an English teacher in the forum who could give you a rule or two. I can tell you a little: in English we stress the most "important" word in a sentence, which means the word whose meaning we most want to communicate. So, a question can have a lot of different stresses, depending on what you want to say. For example:
"Why did she marry him?" (for what reason)
"Why did she marry him?" (as opposed to the reasons NOT to have done it)
"Why did she marry him?" (We know why the other woman would have done it)
"Why did she marry him?" (They could have lived together, or something less permanent or formal)
"Why did she marry him?" (Couldn't she have married someone else?)
So, in your examples: In the first question, the emphasis would be more on the XXX, because the listener must capture the essence of the key variable element: we want to know why they went, sang, left, ate, etc.
The second ("Why?") can be given different inflexions depending on the tone.
In the third, the tone drops on the "why" to give it an extra, almost artificial emphasis.