The blood-brain barrier (BBB) is a protective barrier which is designed to keep the environment in the brain as stable as possible. It prevents many dangerous substances from entering the brain, protecting the brain from an assortment of potential risks, ranging from infection to elevated levels of hormones in the body. Of course, the BBB also hinders some helpful things, making the administration of some medications to treat brain and central nervous conditions rather challenging.
In a sense, the blood-brain barrier is like a protective moat with the drawbridge left permanently up. It is found in the capillaries which lead to the brain. Normally, the walls of the capillaries are highly permeable, allowing a variety of water-soluble components of blood to pass through them and into the body. In the brain, the capillary walls are very compact and dense, allowing few substances through to the brain.
This means that when toxins and infectious materials are floating around in the blood, they cannot reach the brain. For the brain, this is very good news, because the brain is a very fragile organ, and damage from an infection could be devastating. However, some harmful substances can still get through: viruses, for example, can hitch a ride right through the BBB. Substances can also pass through the blood-brain barrier when the brain's host body experiences head trauma in the form of invasive surgery or a severe fall.
Discovery of the BBB is usually credited to Edwin Goldmann, a researcher in 1913 who was trying to understand why the brain failed to change color when dye was injected into the bloodstream. He seized upon the idea of injecting dye directly into the brain, and he realized that the dye failed to spread, suggesting that some sort of barrier was keeping it in. With the development of advanced medical imaging equipment in the 1960s, researchers learned a lot more about how the blood-brain barrier worked.
This protective barrier goes both ways: harmful material cannot get into the brain, but it also cannot get out if it manages to get into the brain. This makes infections of the brain extremely difficult to treat, because the infection can be trapped in the brain, and the medications used to treat such infections elsewhere in the body may not be able to cross the blood-brain barrier. This requires the formulation of drugs which can cross this barrier, or the delivery of drugs directly into the brain.