"Born of a supernatural bloodline, a Warlock seeks to master the perilous magic that suffuses his soul. Unlike Sorcerers and Wizards, who approach arcane magic through the medium of spells, a Warlock invokes powerful magic through nothing more than an effort of will. The font of dark magic burning in their souls makes them resistant to many forms of attack and arms them with dangerous power. Warlocks learn to harness their power to perform a small number of specific attacks and tricks called invocations. Warlocks make up for their lack of versatility by being tougher and more resilient than sorcerers or wizards. By harnessing his innate magical gift through fearsome determination and willpower, a Warlock can perform feats of supernatural stealth, beguile the weak-minded, or scour his foes with blasts of Eldritch power." Source > nwn2.wikia.com/wiki/Warlock
In D&D 5e Warlocks are casters that don`t have magical power due his natural talents like sorcerer or study and dedication like Wizards. They get power due a pact(source > roll20.net/compendium/dnd5e/Warloc )
And in D&D 3.5 ?
"Some people want power, and are crazy enough to offer their soul to various not nice people to get it. Others are simply (un)lucky enough to be descendants of those same people. However they managed to get their abilities, Warlocks wield the powers of the lower planes, which include powerful magic spells and the ability to shoot hellfire out of their hands." Source > www.dandwiki.com/wiki/Warlock,_Variant_(3.5e_Class)