At the very basic level, plain text code eventually translates to 0's and 1's. These 0's and 1's represent low and high voltage levels. At this point, voltage levels control various circuits.
Think of a battery powered fan. Current provided by the battery is powers an electric motor, which inside, uses electricity to create a emag-field which causes a shaft to rotate, which drives the fan-blades to spin. This is an example of how voltage can become physical.
You could build a "switch" that given the proper voltage, will eventually get the power supply to stop pulling current from the wall.
Obviously it's a lot more complicated than that, but that's the gist of it.
To make things easier, computer's are comprised with layers of abstraction.
At the very lowest level is voltages, circuits, transistors, and silicon. The next layer above hardware is the operating system. Rather than re-writing code for every type of hardware access over and over again, the OS manages the hardware, and provides "hooks" to use it. These hooks, or "interfaces" allow your code to have a common method to access disparate hardware. So using the interfaces provided by the OS, you can write your Application.
In each of these layers, there are sub layers: hardware might have firmware--a sort of low-level instruction set that dictates how the hardware should run, stored in EEPROM, and loaded when the drive is powered up, or like the python compiler/interpreter which provides a way to write network software without having to program directly to the raw socket api provided by the OS.
The OS handles most hardware/software interaction. Hardware vendors write "plugins/modules/drivers" which allows the OS to control their specific hardware.
So you would write a software Application that takes advantage of these OS provided interfaces to hardware. For example if you wanted to power down the computer, windows provides an interface to shutdown the computer. Your software would call this interface, and upon compilation/interpretation, turned into code that will call an interface for the OS. This interface, in turn will execute a well known set of instructions to instruct the computer to shut down. These instructions are 0's and 1's, low and high volts, which access a specific part of the computer that is designed to handle powerup/shutdown/standby, and given the right signal, will do just that.