Loss of consciousness, or syncope, can be caused by a number of factors, almost all of which relate to lack of proper blood flow: high G-forces, low blood pressure, low blood sugar, cardiac arrhythmia, and vasovagal responses, such as when I give blood. These all make sense and are moderately well understood. The mechanism of loss of consciousness due to mechanical trauma, however, is less well understood, in part because it can be tricky to study. It almost definitely has to do with lowered blood flow as well, and in particular direct trauma to the brain stem, which regulates consciousness.
Basically, you need to rattle the brain inside its cage, slamming it against the skull. The easiest way to get knocked out from a punch is usually to the chin; the rotational force is much harder for the brain to cushion against, and is a very sharp force. The displacement of the brain from such a force can compress blood vessels, cutting off blood flow to the brain. There's also some evidence that the higher brain and the brain stem can twist around each other, which certainly worsens things. There's even a theory that consciousness is rooted in the neurological structure, which might support the idea that unconsciousness is caused by parts of the brain inhibiting each other.
ETA This isn't exactly a reliable source, but the guy writing this piece for Deadspin is board-certified in internal medicine, and had this (uncited) to say:
Researchers have examined the brain waves of recently concussed animals and determined that their brains resemble that of an animal suffering an epileptic seizure. This comes as a bit of a surprise, because the brain waves (measured by an electroencephalogram) show hyperactivity, which implies that when a fighter is glassy-eyed and unable to answer the referee's questions appropriately, his neurons might actually be overactive, not underactive.
But a hyperactive brain is not the only problem. When the head is hit at high speed, shearing movements within the skull can cause micro-hemorrhages of the blood vessels within the brain tissue. If the shearing force is large enough, or if the head is it hard enough, a large bleed can occur. This becomes a medical emergency because the skull is fixed, enclosed space. As blood accumulates, usually in the form of a subdural hematoma, it can squish the brain and potentially compromise critical neural functions like breathing; death becomes imminent.