Within the framework of Windows and its utilities like Format and CHKDSK, a "Bad Sector" is one that yields an error when it is read. When a HDD is asked for the contents of a Sector it reads it and checks some data error info. If an error is indicated, it tries to re-read the Sector and get good data. If it cannot, it reports this to the OS that asked for the data as a Read Error. In the normal operation of a Windows app, you the user would get a Read Error message and the file in question would be considered corrupted, with consequences for how useful it might be and whether you can recover most of the data and try to fix the error (often you can't).
As a separate administrative process, Windows keeps a file record on the HDD of "Bad Sectors". A Red Error of this type will not cause Windows to note it there. However, the CHKDSK and Format utilities are specifically designed to find and "fix" this kind or error. If they receive a Read Error note from the HDD, they log that Sector into the Bad Sectors file, then assign a new unused Sector to its place in the file. Windows will never try to use that Bad Sector again. BUT the replacement sector it assigned to that place in the file contains no useful data, and hence that file itself is now readable, but corrupted, so it's up to you to try to replace the file with a good copy from somewhere, or edit its contents to repair the erroneous data, or maybe just give up on the file and delete it. The handiest place for having Windows find these Bad Sectors is in a Full Format because that process destroys all old files anyway. When it is done, all the Bad Sectors are placed in the special Windows list and never used, so no new file can be corrupted by trying to use them. Of course, this does not completely prevent the possibility of a "good" Sector's developing a flaw later and becoming "bad" while it contains data.
Full Format will delete the old file of Bad Sectors and write a complete new one. CHKDSK, on the other hand, will keep the old list and add to it if necessary.
Now, a brand new HDD normally has been thoroughly checked in manufacturing, so some people do not bother to do a Full Format on a brand new HDD, but will do it later when re-Formatting an older HDD.
Modern hard drives have an additional completely separate error-correcting process that Windows and other OS's are completely unaware of. Recall that today's HDD's have microprocessors-based controller boards on board with their own BIOS, EEPROM memory and cache RAM so they can do a lot of work themselves. They have an error-correction system that basically works like this. Each time a Sector Read comes in from the OS, the quality of the electronic signal read from that Sector is assess by the HDD itself, as well as checking for data validity. If it's fine, the data is sent out as requested. If it is a weak signal but with valid data, the data is sent out again. But the HDD then replaces that weak Sector with a spare good one. (Back at the last stage of manufacturing when the true Low Level Format is done, the HDD stores the locations of all the excess Sectors it has (yes, it has more than its specified space) that are good in a table on the HDD for this use.) It then writes the known-good data from the weak Sector to the new replacement, thus restoring the file to perfect condition. The weak sector is noted in another on-disk location and never used again. If the original Read generated bad data, the HDD will try several times to re-read that data and apply error-correcting tools to try to get valid data from the poor signals. If it succeeds, the good data are sent out, and the process of replacing the Sector with a spare good one is carried out, including writing the re-constructed good data to the replacement Sector. If, however, even the re-read and analysis process fails to get good data, the HDD will report to the OS that it got a Read Error and cannot provide valid data from that Sector. It will then go through the Sector replacement process, but this time it cannot write valid data to the replacement Sector. In the meantime the OS (e.g., Windows) will do its own thing for handling a Read Error. So the modern HDD actually has a better process for Read Errors from a Sector than Windows does, and it's all invisible to Windows The HDD only reports a Read Error if it cannot fix that itself.
Now, that internal process on the HDD only happens when a Sector is Read. But there's a useful (though time-consuming) process that will force the HDD to examine ALL of itself. It is a Zero Fill - a process that writes just zeroes to EVERY Sector of the HDD currently available (but not including the hidden collection of spare Sectors). This works because by default, every time the HDD writes data to a Sector, it reads it back again and checks that it matches what was written. (This is also a part of the internal self-checking routines.) That Read process involves all of the signal analysis outlined above, as well as the data comparison. Hence every Sector filled with Zeros (and that's all of them) will get tested, and all questionable ones will be replaced by the HDD itself. When the process is finished, to the outside world (read: Windows or other OS), this HDD is perfect - it has NO Bad Sectors available.
Now, this latter internal process depends on having a stock of known-good spare Sectors to use as replacements. Over the life of a HDD, more and more will get used up. At some point the remaining stock gets so low that it MIGHT in the near future be unable to replace a bad Sector with a good one. This triggers one type of alarm message from the on-disk reporting system called S.M.A.R.T. So if your BIOS is set to Enable SMART monitoring of the HDD's, when this happens you will get a warning that the SMART status of the HDD has failed, and it will be up to you, the user, to find out exactly what type of SMART error warning has come up. That usually means using a diagnostic utility. If you get a SMART message saying that the cumulative faulty Sector count of the HDD has exceeded the set limit, that's a warning that the HDD is still working fine now, but MAY not be able to keep fixing itself for much longer. That is when you buy a new HDD and clone the old one to it, BEFORE the HDD actually fails and has data corruption to deal with.
Long story, maybe with more info than you wanted. But it's interesting just how much behind-the-scenes stuff is going on the prevent data loss.