I never gave a thought to the origin of this before. Now, deciding to check it out, I could kick myself. The root was screamingly obvious - wizard = wise + -ard - wise man. I cast a suspicious eye at warlock but decided there was nothing at all obvious about this one Nor is there.
Etymology: Old English wǽr-loga weak masculine traitor, enemy, devil, etc. = Old Saxon wâr-logo weak masculine ? deceiver (once, Hêliand 3817, in plural wârlogon applied to the Pharisees). The first element is probably Old English wǽr strong feminine covenant = Old High German wâra truth, Old Norse várar strong feminine plural solemn promise, vow (compare Vǽringi confederate, Varangian); compare Old Church Slavonic vĕra faith. This is a derivative from the adjective represented by Old English wǽr true (once, Genesis 681; ? < Old Saxon) = Old Saxon, Old High German wâr true < Old Germanic *wǣro- < Pre-Germanic *wēro- = Latin vērus . The second element (an agent-noun related to Old English léogan to lie v.2, belie, deny) occurs also in the similar comps. áþ-loga, tréow-loga (Old Saxon treulogo), wed-loga (Middle English wedlowe), an oath-breaker, etc.
This seems to have been the original sense of the present word, but the special application to the Devil (either as a rebel, or a deceiver) was already in Old English the leading sense. The applications to sorcerers, with especial reference to the power of assuming inhuman shapes, and to monsters (especially serpents), appear to be developments, partly due to Scriptural language, of the sense ‘devil’.
Info as usual from OED. Earliest cite for the sense one in league with the devil, sorcerer, etc is 1400. Earliest sense seems to be oath breaker, traitor (1023).