Because the brain is such a critical organ for the functionality of your body, your body has adapted to protect it with as many fail-safes as possible.
One of the things that your body does to protect the brain is keep it isolated from a lot of other organs with something called the blood-brain barrier. This is a barrier surrounding blood vessels in the brain that prevents unwanted chemicals or debris from getting to the brain through the blood, and instead, only allows the brain tissues to absorb necessary fluids, like blood and water.
The blood-brain barrier is made up of endothelial cells, which have tight junctions in between them that allow the necessary fluids to pass. The junctions are tight enough to restrict unwanted toxins so that only the essentials are ever absorbed by brain tissue through diffusion.
Not all parts of the brain have blood-brain barriers, but most of the brain does. The parts that do not are thought to have a reason not to have a barrier, such as being able to sample and regulate blood conditions to fight off infection, inflammation, and other issues.