There are repeaters on the cable every ~50-200km (depending on technology), powered by DC power carried on the cable. There are branching units powered the same way -- I believe they handle branching at the fiber level, rather than waves, but not sure of the specifics on modern DWDM cables. (they can run ~80-160 different frequencies of light on the same fiber, and the cables contain multiple fibers...)
No idea of what precise sort of hardware is there, but the fact is that these cables consist of a bunch of fibers. Dozens of them typically, quick search suggests up to 144, but I doubt that's a physical ceiling. So I suppose they make a branch when needed, with some number of fibers going to another direction.