We have NUMEROUS neurons in our head. How do they know with which other neurons to connect to form a functioning network? The process you are looking for and we are going to talk about now is called Axon Guidance. Ever heard of it?
In general, a neuron consists of three parts. The cell body (= soma), the dendrites (= the small branches on the cell body that receive info) and the axon (= the long ‘arm’ or cable reaching out to pass on info). In order to pass the info to the next neuron, the axon needs to form a synapse (= connection site) with it. But for that, it needs to know where the next neuron is located.
Imagine you are in a dark room and are supposed to high five your buddy. How do you figure out where to reach? Right! You communicate. Your buddy would either talk to you or make noise and you would follow it. If you wouldn’t have your ears, you would probable follow your sense of smell (that’s how a blind doggo would do it).
Neurons do something similar when trying to find each other. During neuro-development, they have something at the end of their axon called growth cone (= the tiny hand like structure you can see in the picture), first discovered by Ramón y Cajal in the early 19th century. With the receptors on the growth cone, the neurons ‘sniff out’ their environment. Meanwhile other cells, including target neurons, are releasing so-called guidance cues. These can either be very attractive (= attractants, “I’m here!”) for the searching neuron, or aversive (= repellents, “Go away!”). Depending on the cues, the axon of the neuron either ‘growths’ in their direction, or continues ‘searching’ in another direction until finding the right partner to connect with . This is done by changes in the cyto-skeleton (= cell skeleton).

Talking about efficiency of the brain: Connections that neurons made with each other don’t necessarily stay forever. Neurons need to tell each other constantly that they are still there, otherwise the connection or even the whole neuron will be removed.
Note: axon guidance is a very complex process in reality. There are numerous different guidance cues, some specific for short and some for long distances.