Here’s how I typically explain the explanatory 「の」 when I teach it to my students.
Question: I don’t understand the difference between the two:
I fire back with another question: How would you say, “Isn’t there class today?”
「今日は授業がありませんか？」 simply means “Is there no class today?”
“Isn’t there class today?” sounds like the speaker is expecting to have class today and is surprised that that may not be the case. That’s what we call seeking an explanation, which requires using 「の」.
So the answer is:
The simple answer to such a question would be:
Similarly, 「今日は授業があるんです。」 is saying that there is class today as an explanation for something. For example, maybe you want to explain why you can’t go to lunch.
It helps to figure out the difference by looking at a situation where you have to use 「の」 to say something. There is no way to say things like, “Isn’t there class today?” without using 「の」.