By taunting cobras from behind his visor, Young discovered their secret. The snake waits for a particularly jerky movement to trigger its attack and synchronise the movements of its heads in the same way. It shakes its head rapidly from side to side to achieve a wide spray of venom. And it even predicts the position of its target 200 milliseconds later and shoots its venom at where its eyes are going to be.
The finer details of how the cobra does this is explained at Not Exactly Rocket Science. Link