No matter in what language a software program is written, ultimately it is converted to the hardware language of 0s and 1s and the computing problem is solved at the hardware level. Therefore, having a mental picture of hardware is necessary to design efficient algorithms. Good programmers tend to understand their hardware well, and many of them prefer C/C++, because those languages provide the closest abstraction of hardware.
The best way to understand how a program works is by having a mental picture data flow through various pieces of hardware. Unlike sofrware programs, computing hardware is infinitely parallizable. The best way to visualize hardware is to think about flow of water. During a computing task, your data flows from its point of origin through various barriers and computing elements, get modified and finally get saved as results of calculation.
Here is the simple picture of hardware. At first, raw reads sit in the hard-drive. When a program processes the reads, data gets pulled from hard-drive to memory. During every calculation, it goes through the processor and memory blocks are updated. Periodically, or at the end of calculation, data gets written in hard-drive.