How does programming code provide power to electronic circuits?
I think you are not aware that just by executing any code, there are tiny switches inside the CPU flipping, making current flow. That's how the CPU works internally.

On CPU level, code is just a preset arrangement of tiny switches to start with as soon the reset switch is released.

The difference between any code and code that gives nonzero voltage on an output pin is just that there's an additional switch flipped which leads to an output pin rather than only those which are connected only internally.