Most hard drive utilities from the hard drive manufacturers check the hard drive from a low level - it looks at the information stored in the chips on the drive, performs some low-level checks and drive performance tests. These utilities are designed to be fault-tolerant and work in conjunction with the circuitry on hard drive to determine exact problems - whether it is a mechanical or media issue, what kind of error codes are being stored by the drive’s diagnostic systems, translate those error codes to something useable by the technician or end-user, etc.
All scandisk does is compare the file system to the FAT table, making sure there aren’t any inconsistencies between what the FAT table says and what the file system actually shows, checks the boot sector/Master Boot Record to backups that have been put in a supposed inaccessible area of the drive, then do read/write tests to each of the sectors using basic DOS interrupts - if it can’t read/write to a sector of the hard drive and crashes, it usually winds up being a mechanical issue - there is a problem with the head actuator arm that won’t allow it to position itself where scandisk/the OS says it needs to be - then scandisk hangs or crashes. If the problem is with the media itself - ie, the heads can move where necessary, but the electrons just refuse to line up properly in that sector, it recovers what data it can (depending on the defaults you have set), then marks those sectors as bad so the drive won’t attempt to write any more data to that part of the drive. Scandisk, though, has never been good for diagnosing anything other than blindingly obvious errors.