Data corruption can occur at many different levels and in many different ways. It could be that the in-memory consistency of a data structure gets corrupted by concurrent manipulation. Or it could by simultaneous writes to a file on disk. How it is detected is determined on a case-by-case basis.