Data (all applications, photos, music, documents) are magnetically "written" to the discs of the hard drive.
Software tells the hardware what to do in any particular application.
does clicking on the icon,
tell the CPU to open the data that is written on the hard drive ?
Essentially, Yes.
Clicking on an applications icon begins a software chain reaction process which activates the necessary hardware components and loads the necessary software components for processes necessary to said application.
When you want music played, the data for the song is read from the hard drive, buffered through the memory (RAM is a bus station where data waits to go for processing or be fed to a different component or channel), decoded and processed by the processors, returned through the memory and fed through the appropriate channels in the hardware to be produced as sound.
When music is added to your library, the data is read off a CD, buffered through the memory, processed and encoded by the processors, rebuffered through the memory and fed through the ATA bus to the hard drive, where it is written to disc.
Of course, all of these processes are controlled by software commands, either from the hard drive (in the case of OS and applications) or from ROM (Read Only Memory) chips, which are embedded throughout system components providing root operation coding; this is known as firmware.
Anyhow, there is a lot more to this than the simplistic explanation.
Suffice it to say that a hard drive stores data that is to be manipulated, updated and utilized as a person deems necessary.
Hard drive space is also utilized by the system to store "temporary" commands, files, caches and logs.
This is why it is vital that a drive have free space that is never filled with user data.
OS X needs to have 10 GB free, applications need additional GB's free, and the process of burning a DVD will require an additional 12+ GB free space.
Having 20-30 GB of free space is vital to good system performance.
More is better, as it allows data to be written in closer, contiguous blocks, rather than scattered about (fragmentation) which is detrimental to a system performance.
For an operating system drive, maintaining 40-50% free space is highly recommended, as filling the drive further dramatically decreases the performance of the drive until the system can't move when the drive exceeds 90% capacity.
Less than 10 GB free space is dangerous, with the potential for fatal errors, data corruption and data loss high.