About the same as you debug an issue from having just a tracelog. The rocket and pad equipment have quite a few sensors that record information, so you have quite a lot of data afterwards to spot anomalies (you could also compare to previous successful launches / static fires to spot them). Admittedly, that doesn't really explain how they figure out some stuff, e.g. with CRS-7 the problem was with a strut holding a high-pressure helium vessel in the second stage. They likely would have seen the overpressurization of the tank and there are not many sources for that pressure, but pinpointing it to a piece that doesn't even exist anymore ... beats me.