Fainting is not solely caused by external factors. Your genes also play a part. This has recently been documented by research team from the University of Copenhagen, Statens Serum Institut and Rigshospitalet. Based on data from more than 400,000 individuals they have identified the first gene that predisposes to fainting.
Source: EurekaAlert, https://www.eurekalert.org