As in title,
- Don't they know it?
- Do they not know it?
Are these sentence the same? or the second sentence is plain wrong?
Is there any case where they are different?
Don't they know it?
Do they not know it?
They are both correct. It is a difference of register. Sentences with contractions such as don't are used in less formal contexts.
Though some have suggested a difference in emphasis, "Do they not know it?" is simply the usual word order in cases where the contraction don't has been avoided. By contrast, "Do not they know it?" sounds very awkward, although where a noun is used instead of a pronoun, both word orders are used:
Do the citizens not know it?
Do not the citizens know it?
Similarly, "Aren't I ..." usually expands to "Am I not ..." (I have never heard "Am not I ..." and it may be ungrammatical); "Isn't he ..." becomes "Is he not ...", and so on.
Effectively they are exactly the same meaning.
The is a very slight difference in emphasis. Sentence 2 sounds slightly more like they are actively not knowing rather than passively failing to know. When spoken, sentence 2 allows stress to be put on the word not.