Have you ever driven somewhere and you don't remember how you got there? You can thank this part of the brain!
The basal ganglia are a group of nuclei of varied origin in the brains of vertebrates that act as a cohesive functional unit. They are situated at the base of the forebrain and are strongly connected with the cerebral cortex, thalamus, and other brain areas.
The basal ganglia are associated with a variety of functions, including voluntary motor control, procedural learning relating to routine behaviors or "habits" such as bruxism, eye movements, cognitive, and emotional functions.
When you have those "how'd I get here" moments when driving, it's the basal ganglia that has taken control.
Experimental studies show that the basal ganglia exert an inhibitory influence on a number of motor systems, and that a release of this inhibition permits a motor system to become active.