You say "They are" like they are a playable class.
Also, if they were the same thing the game itself would not indentify then as two different types of classes, with bosses and Npcs that are Necromancers and those that are Death Knights.
And like i said before, they are supposed to have similar concepts but different playstyles.
Holy Paladin being a warrior of the Light that heals in different ways and Holy Priests a mage wielder of the Light that heals in a different way.
Demon Hunter and Warlocks, both have the demon theme but one is a half demon and the other uses demonic powers, be summoning demons or using fel magic.
We can also count Shadow Priests and Aff Warlocks since both use Shadow magic, but have different playstyles and Warlocks add fel magic to the mix.Blizzard even acknowledges this in the Legion class preview.
"Affliction
Affliction warlocks are masters of shadow-touched powers, but unlike shadow priests—deadliest when pushed to the brink of insanity—these warlocks delight in using fel forces to cause intense pain and suffering in others. They revel in corrupting minds and agonizing souls, leaving enemies in a state of torment that would see them undone in due time. Even the most battle-hardened warriors can be deceived, landing blow after blow against the warlock, only to succumb to their suffering as their very vitality is siphoned away by the dark spellcaster. "
Source:https://worldofwarcraft.com/en-us/ne...series-warlock
They both use Shadow magic but in its own unique way.