The tiny bits of code that can wreck computers

In 2013, University of Cambridge researchers estimated that computer bugs cost the global economy $312bn (£241bn) every year. Even little bugs can be expensive – a misplaced line of code can render warships immobile, for example. How, exactly, is it possible for these miniscule bits of code to wreak such havoc?