Vasovagal syncope is the most common cause of transient loss of consciousness. The vasovagal reaction happens when a person faints because his/her body overreacts to certain triggers, such as the sight of blood, extreme emotional distress or physical pain.
In general, The vasovagal syncope trigger causes your heart rate and blood pressure to drop suddenly. As a result, your brain may not get enough oxygen-rich blood, which causes you to pass out.
Featured image: wikipedia