How to use “ 难道 ” in Chinese sentences?
What is the difference between 你不知道吗？ and 你难道不知道吗？
> Don't you know it? (I thought that you knew it.)
> Don't you know that ......
> Don't you understand?
> Ain't that the truth?
> Don't you have to work today?
> Aren't you coming?
Personally, I believe it's sometimes better to put 难道 in the beginning, though most of the time, the order doesn't matter in spoken language.
Not a comprehensive answer, but:
难道 gives special emphasis to the question, like "Could it be that...?" and can be used to contrast with what was previously said, especially to expose some presumption or surprise (that could serve as an explanation for what has been said previously.
[usually, there would be some pause between the two sentences because the speaker needs some time to draw the concluding second sentence from the reaction or response of the other speaker]
"Aren't you joining us to go swimming tonight? Or perhaps could it be that you can't swim?"
(Not very elegant translation, but points out the meaning of 难道)
The difference between the two sentences you provide, should now be clear, the second one expresses the surprise over the reaction or response of the other person in a form of presumption/speculation (It's not necessary that the other person does not know [whatever it is], but we just make a guess). The first sentence is just a plain question with no speculative character.
难道 is used to express “can it be possible that…” or “maybe” with the subtext that “it should be” or “someone should”.
Sometime with an exaggerated tone.