The basic building block of a digital system is a gate. Gates implement basic logical functions like AND, OR, NOT (inversion) and multiplex.
Gates, in turn, are ganged together to implement higher level functions like arithmetic, registers, data routing and storage.
At the electrical level, gates are made of transistors. The transistors operate as switches to implement the gate functions, passing or blocking current under the control of another input.
It is possible to build a computer using only one kind of gate. As long as you have something that can do an OR or AND, and an inversion, you can make any kind of logic with it. The Apollo Guidance Computer, for example, made do with only one kind of logic: a NOR gate.
For illustration purposes, here's a CMOS version of a NOR gate:

The CMOS NOR function uses two types of switch transistors: P-FETs and N-FETS (the P-FETs have the bubble on the control input, also called a gate.) Follow the truth table to see which FETs will turn on, and how this will drive the output.
Can you see how such a gate could be used for AND, when combined with inverters? That's a trick called DeMorgan's Theorem and it's how those slide-rule folks did it back in 1969, and how it's still done today.
Speaking of inverters, here’s how that looks in CMOS:
