Q. “What do they mean?”
A. Two different things
- “…share 99.7% of their DNA” is fairly straightforward.
This means that if you compare, base for base, the total DNA sequences of a group of Neanderthals with a group of humans — doing appropriate statistics — you will find, on average, 99.7% identity.
- “1–4% of the DNA of living non-African humans…likely come from Neanderthals” is more nuanced.
This is because that 1–4% (generally thought nearer 2%) that is thought to come from Neanderthals could still be 99.7% identical to the human DNA it is thought to have replaced.
How can that be?
First let us assume that there are no genes unique to either humans or Neanderthals. (This may not be true, but the assumption emphasizes that we are considering the same genes.) Now suppose that after the divergence of Neanderthals and humans from their common ancestor the Neanderthals acquired a mutation that produced a new haplotype for a particular gene that spread to all Neanderthals. The percentage difference in DNA would be small, but the haplotype and hence the gene counts as Neanderthal. If it enters the European human population by interbreeding after emergence from Africa, then that gene is regarded to have come from Neanderthals. So the idea is that this is true for approx. 2% of non-African genes, even though the originating Neanderthal DNA may be 99%+ similar in sequence. Likewise, differences are observed between Africans and non-Africans in these gene haplotypes, even though the DNA sequence otherwise is very similar.
I have not discussed the evidence for this 2% gene haplotype difference here as I recently covered it in an answer to another question, specifically on that topic. (Hence my somewhat late interest in this question when it re-emerged.)