It is called "disk formatting", or simply "formatting", to the series of operations carried out in order to restore a hard disk, a USB memory or any device that houses data, to its original state, erasing, not definitively, the data it contains. Generally, this allows the device memory to be rewritten with new information. On some occasions, you can proceed to partition the hard drive; this is to create several independent partitions, within the hard disk, that can support different file formats.
There are two types of formatting; the first one is called "low level" or "physical formatting", with which the disk can return to its factory state. This consists of the erasure, by the head, of all the sectors into which the disk is divided, leaving them without data. This is characterized by being a very slow process, due to the rigor with which it has to be carried out. In the same way, it used to be applied, by the manufacturer, to all the machines before being distributed, so that there is no access to previous data on the machine; However, with the advancement of technology, normal hard drives do not need low-level formatting.
Another type of formatting is "high-level" or "logical", the one done quickly and partially, which is characterized by editing the file systems in each sector of the hard disk, causing it to delete them. In this way, you can have the full hard disk space again, even if the files still exist; after a while, and with the storage of new data, the previous ones will be rewritten, making them unrecoverable.