The word comes from “vet” as in “veterinarian,” Juliet Lapidos reports in Slate‘s Explainer, and the Oxford English Dictionary confirms it. On reflection, it makes sense — from veterinarian to “To submit (an animal) to examination or treatment by a veterinary surgeon” to “to investigate the suitability of (a person) for a post that requires loyalty and trustworthiness” — but I wouldn’t have expected it.