Branches don't grow straight like broom sticks, at least most don't. but they don't wander like errant snakes either. There's a system! Here's a quick idea of how that system works. Now I am not a botanist, and you don't need to be either, so this is a simplified look at what goes on with branching.
A branch starts out as a twig of course, in the spring that growing twig develops buds, they are arranged in different manners according to the specie of the tree. As the season goes on not all of the buds grow equally, some thrive, some are minimal and some die. For instance at the top of arrow 1 is a place where there were two buds, the one that was favored became the continuing branch and the other became a lesser branch. At the fork, marked 2, the right hand bud was so favored that the left hand bud died. At the fork 3 the lower bud grew, and was favored and the upper bud was relegated to secondary status.
As the tree ages these branches grow thicker and become limbs, you can look at the limbs of a tree and see the history of success or failure of different buds preserved there. Some sorts of trees throw buds in groups of three and some in spirals around a stem, and others on alternate sides of a running stem. But in all of those, the turns and elbows of the branches are a record of the success and failure of individual buds in the first season of the twigs growth. Watching for and being aware of that will help make some sense out of the branching and forking of tree branches.
Here is a birch doing the same thing. At 1 the bud that runs horizontally has been favored over the one that runs vertically, usually that happens because the favored branch has a better and less obstructed path to the light. The branches seek to unfurl their leaves in the sun. At 2 the same triage has happened initially both buds formed twigs the same size and as time went by, the more successful of the two was favored. Sometimes a bud will survive as minor branch or twig, and sometimes it will die but each of those events determines the course of the branch.