After a data storage device has been manufactured, it needs to be formatted before it can be used to store, retrieve, or process data. Not only is this true of hard disk drives (HDDs) and solid-state drives (SSDs), but it's true of memory cards, USB flash drives, floppy drives, and nearly any device that is used to store data. In most scenarios, this process is completed long before it ever hits store shelves or the hands of consumers - but there are some cases where the user might need to format their device.
Low-Level Formatting
In older computer systems, particularly those that used floppy disks and the earliest iterations of mechanical hard drives, all low-level formatting was completed by the disk drive's controller. In the case of the 1.44 MB floppy disk, which was the standard at that time, the low-level formatting operation created 18 sectors with a total of 512 bytes on each. This amounts to a total of 80 tracks on each side of the disk's platter, for 160 tracks overall, and resulting in a disk storage space of 1,474,460 bytes, or 1.44 MB.
However, there were various shareware and freeware programs that could effectively increase the size of the standard 1.44 MB floppy disk. By using various techniques, such as head / track sector skewing, sector interleaving, and others, some traditional floppy disks could be formatted with a capacity as high as 2 MB.
In the late 80s and early 90s, however, manufacturers began performing low-level formatting on HDDs at the end of the manufacturing process. The process is still used today on both HDDs and SSDs.
Partitioning
Most modern storage devices, like hard drives, can be partitioned into different sections. As the name implies, this simply divides the total storage capacity of the device into smaller chunks. This is typically done to help organize the data on the disk and to separate system files from personal files. Since traditional 1.44 MB floppy disks were incredibly limited in usable storage space to begin with, most of these early disks were never partitioned.
High-Level Formatting
This method of formatting is used, sometimes known as logical formatting, is typically done by the end-user. For most operating systems (OS), it's the default technique used when formatting a drive. Not only does high-level formatting erase the contents of the drive - if any - but it also sets up the necessary boot information, file system structure, disk clusters, and more.
Quick Formatting vs. Full Formatting
Depending on your OS, you might have the option of performing a quick or full format. While the quick option is obviously faster, it doesn't actually delete any data. Instead, it simply erases the journal that contains all of the pertinent information - such as its physical location on the drive - to make the data inaccessible. In contrast, a full format, although it takes considerably longer, will delete any data that is contained within the drive.
Understanding Disk Formatting
Disk formatting isn't always a straightforward process. As a consumer, most of the formatting you'll do is considered high-level formatting or partitioning - low-level formatting is still, for the most part, performed by the manufacturer.
You may read more about disk formatting in Wikipedia: Disk formatting.