Let me help clear up a few things around "Bad Sectors", Formatting, and Defragging, and how they might impact disk performance.
A disk may have some sectors on it that do not perform properly. In fact, when first manufactured, I would bet every disk has a few. The first line of defense for bad sectors is built into the drive unit itself and generally not noticed. The drive has a controller board on it with many functions. On of them is to track the sectors and it keeps its own records for that. When the disk is first made, it has more usable sectors than needed for the stated capacity, and all of those are hidden in a reserve place. As the disk is used, the board makes close checks on the quality of the signals of every read operation. If it detects poor signals from a sector it picks out a good one from its inventory of spare sectors, copies the data to it, makes the substitution, and retires the questionable sector to a "never use these again" list. You will never see this happen if it all works because the substitution happens BEFORE the signal is so poor that you lose the original data, and Windows will not know about it, either. However, in a few cases the disk damage may be very sudden and destroy the data in the sector before it can be read and copied. In that case the disk will make the substitution, alright, but it does not have valid data in the replacement sector so it will have to let Windows know there is a "bad sector" with data that can't be used. After a long time with this sort of disk-level hidden fixing going on, it is possible that the disk control board may run low on its inventory of spare good sectors. At that time it will trigger a warning through the SMART system that it is running low on spares. Your best response then is to buy and install a new drive and move all your data to it while the data is still good, then throw out the failing drive.
Many drive manufacturers make available for free on their websites a suite of diagnostic tools for their drives. You download and run them on your machine on each hard drive in turn. One class of tests goes through the entire disk and performs a very thorough analysis of each sector's quality, just in case the routine checking process missed something. It will completely update that automatic system so that there are no undetected weak sectors in use, and check that the stock of good spares is still big enough to continue normal operation. You should do this as your first step in making sure your old drive is ready for further use.
When setting up a disk (brand new and empty, or older and used), two steps normally are done. One is to establish the Partition(s) - that is, how blocks of the physical space on the drive unit are allocated to Partitions that each will be treated as completely independent "drives". Then each of the Partition(s) must be Formatted to establish on it the File System to track its use for files. When Format is run you have two options. A Quick Format establishes all the files, etc. and makes sure they are empty, and does little else. A Full Format will do that and then proceed to a test of EVERY sector on the disk by writing something to it, reading it back, and making sure it is right. (Well, it really is only working with the physical sectors that the disk controller board makes available, and Windows Format is NOT aware that there are other hidden sectors on the disk.) If Windows Format finds any sector it thinks is faulty it marks that sector in its own on-disk tracking files as "Do Not Use This One Ever", and it won't get used by Windows after that. Any sectors like that are what show up in the summary report as "Bad Sectors". For a new disk, especially one that has been through the manufacturer's utility check process, this should not be necessary, but many people (myself included) will do it anyway just as an extra precaution. The downside is it takes a lot of time. We did it recently in a brand new WD Green 1.5 TB unit and it took 5 hours.
After a disk has been in use for a while it is still possible, but rare, that a sector that was good can go bad and yield bad data. To deal with this possibility, Windows has a tool called Chkdsk. It does a lot of checks on the data and the files that track the allocation of sectors to files to make sure the tracking files are all correct. Then it has the option to do a "Surface Scan". This is very similar to the Full Format operation with an important exception. For each sector it must first read the data and store it. Then it can write, read back and compare, etc. When done, it must restore the original data to that sector (or to its replacement if that was necessary). The small problem is that, if Windows finds what it considers a bad sector and replaces it, then puts its data in the new place, you have no guarantee that the data itself is good. There MIGHT be an error in there. Again, if Windows does decide that a sector is bad in this process, it is marked and set aside, and the report will show that it found and fixed some "Bad Sectors".
With no Bad Sectors or errors involved, the normal use of the disk assigns sectors to be used by files, and often frees up previously-used sectors for re-use. Over the longer term, the result is that any one file may have blocks of sectors from all over the disk surfaces assigned to it in odd patterns. This means that, when the file is used, the disk mechanism has to go running around to get these sectors in the proper sequence, and that is slower than if the sectors were all in one continuous block. This is Fragmentation. The Defragmentation operation fixes this. First it studies the disk and plans its operation. Then it identifies a block of unused sectors it can use temporarily. Repeatedly it copies data from used sectors to temporary places, freeing up those previously-in-use sectors so that it ends up with big blocks of unused sectors. it especially makes sure it clears things out near the start of the disk. Then it copies the original files' data back to these recently-freed-up sectors in contiguous blocks, freeing up its own temporary places for re-use. In this way it can reorganize almost all the disk files so they are in contiguous blocks instead of being scattered about, and disk access speed is improved. This has absolutely nothing to do with Bad Sectors or errors. In fact, this should be your last step - you want to be sure all the troublesome sectors are set aside before you start moving all your data around.
When you're going to do a new install of the OS, I recommend that you first download and run the test suite from your disk manufacturer, so the disk condition is known good. Then, when you do the installation and it sets up your disk at the beginning, let it do the Full Format (that's usually the default) to be extra safe, but realize it will take many extra hours! When the installation is finished there will be almost no Fragmentation, so a Defrag is not going to be needed for quite a while.