Scientists are beginning to unravel the complex circuitry behind the split-second decision to beat a hasty retreat