Mostly just bad luck and the key is to treat them early before they get ‘roots’ and become very ingrown. In the genital area warts are often sexually transmitted.