Program is just a sequence of pulses/switches. Switch on your fan, bulb and motor. Name the buttons F, B, M. And you have made a language. Bring a microcontroller or rasberry or what ever. Feed the squence in their memory, registers or flip flops. Play it whenever you want and you will turn on the fan,bulb,motor with the same sequence.
Basically its your clicking on the keyboard that turn on the switches of transistors etc. Transistor is i guess the smallest unit of computers.
These transistors make many things. For example they make flipflops which make resisters which make memory.