Warlocks are people that learned their powers from some manner of powerful otherworldly creature or force. Learning these abilities range from actually entering into a Faustian bargain, to finding lost tomes of unknown origin. The creatures that grant this power aren’t necessarily evil, but they often have reasons and methods not entirely understood by mortals.
Warlocks can come from any background, but one that seems particularly common is a student looking for power they think they deserve, but their teacher refuses to provide. After entering into their pact the student is then expelled from a formal school, or rejected by their master.