This isn’t super obscure, but it’s also not the sort of thing that any of us (native speakers) have to know explicitly. We do it without even realizing what we’re doing. But your books don’t seem to explain the situation very well. A better book (mine’s the Cambridge Grammar) will lay out these distinctions more clearly.
One of the key ideas is the sense of immediacy from “going to”, which is easier to see with some example sentences. “Going to” is clearly the closer danger.
That glass is going to fall off the table.
That glass will fall off the table.
And if it’s already started happening, then “going to” is a much better choice. Again, this deals with immediacy: something that’s already started is very immediate.
If you’re going to whine like a little bitch the whole game, then I’m not going to / won’t play.
[sup]?[/sup]If you will whine like a little bitch the whole game, then I’m not going to / won’t play.
There’s also a conditional interpretation related to this immediacy. “Going to” can indicate that the plan is already in motion, whereas “will” might indicate a future condition that’s available if needed.
Yeah, my friend is going to burn you a copy of that CD. [It’s already arranged.]
Yeah, my friend will burn you a copy of that CD. [If you ask.]
And finally, “will” can convey a sharper decision. We would be less surprised if he changed in his mind with the first sentence.
I asked him to come to the party, but he said he wasn’t going to.
I asked him to come to the party, but he said he won’t.
Play with some more examples sentences along those lines, and you’ll be able hash out the distinctions more explicitly in your mind, which will make it easier to teach.