On the back side of an internal hard drive (or somewhere inside the enclosure of an external HDD) is a piece of green circuit board with all the electronic resistors, capicitors, and other bits and pieces that hold it all together. All the other parts are connected to the circuit board, which contains basic electronic instruction known as firmware, which tells it all just exactly how to work. It is into the circuit board that you plug your power cable and data transfer cable (often SATA, PATA, or on some older systems, IDE and UltraIDE). The circuit board receives electronic impulses from the rest of the computer and sends the appropriate instructions to the spindle and the drive head, which all work in perfect tandem to find the right data.
Clearly, there is more to the specifics of specifically how data is stored, read, and altered by magnetism and electricity, as well as the minute construction and precision of a hard drive's manufacturing. However, understanding these basics is the first step in a larger understanding.