The Falcon 9, as its name implies, has nine engines, and is designed to go to orbit if one of them fails. On-board computers will detect engine failure, cut the fuel supply, and then distribute the unused propellant to the remaining engines, allowing them to burn longer. This seems to be the case where that was required, and the computers came through. The engines are also built with protection to limit the damage in cases where a neighboring engine explodes, which appears to be the case here.
via That smooth SpaceX launch? Turns out one of the engines came apart | Ars Technica.