But what about the branches? How does that work?
As far as how they do it, it's conceptually simple (these days there are "fancier" options with steerable drillbits). You put a tool down the borehole that you can expand and lock in place at the desired depth. When it's expanded, it forms a ramp towards one side of the wellbore. You then lower the drillstring, and when the bit hits the ramp, it's deflected in the direction you want it to go.