There are several factors. Within the same product line, say consumer PC grade Maxtor 3.5" drives using the current areal density standard du jour, the entry level product is a single platter with just one read/write head. The next step up is a second read/write assembly using the opposite surface of the platter. From there the next step is another platter with a single r/w head and from there a second head. This goes up to drives with four (the typical maximum these days but the big stacks in the mainframe era could have several times more)platters and a read/write assembly addressing both sides of each platter.
So, within the same generation of drives, assuming perfect manufacturing, the additional cost is mainly the additional read/write heads and platters, plus some additional manufacturing complexity and time. But manufacturing is never perfect. Just as a CPU line tries for the top speed every time but ends up producing a range of speeds after testing, hard drive production has its issues. For instance, for most drive form factors, except those that only permit single-sided platters, the target in platter production is always a double-sided product. A good percentage will fail testing on one side but be perfectly good on the other and fully suitable for use in a single-sided drive. That is a big savings compared to just junking the entire platter. Also, a good platter side may not meet its target capacity. Error areas that are completely harmless if they are found in testing and marked as unusable in the drives firmware. All drives have less than their best case scenario capacity but many sold as low capacity can have as much as 40% unusable area. People aren't given to complaining if it means they get the low capaity models for cheap.
When Western Digital and Microsoft issued a joint press release announcing the supply deal for Xbox hard drives a few years ago, I was amused to see at the bottom, in the area where the two companies were given brief descriptions, that WD's included a sentence touting them as being the first company to standardize on 15 GB per side 3.5" platters. This raised the question of why the Xbox would only have 8 GB (officially, more often 10 GB in practice) of hard drive capacity. none of the companies involved will reveal the full details of the deal but Microsoft managed to score the then lowest ever price per magabyte on commodity hard drives by offering WD and Seagate a way to move product that might otherwise have been unsellable for, if not a profit, at least other than a complete loss.