First of all, in order to be guilty of a crime the state has to prove two things: that you committed the criminal act (also called the actus reus) and that you had a criminal intent or mental state (the mens rea). Both of these elements must be proven beyond a reasonable doubt in order to convict someone of a crime.
Mental state issues come into play when the defendant puts up what's called a 'mens rea' defense---for example, an insanity plea. Another type of mens rea defense is generically called a 'diminished capacity' defense. This just means that there was something about the defendant's thinking that impaired his ability to form a guilty intent, but this 'something' is not so severe as to be considered insanity.
The most common example of a diminished capacity defense is acute substance intoxication. By law this is barred as an insanity defense, but it can reduce mental state culpability to a more serious crime. For example, someone charged with first degree murder could be acquitted of that charge because of intoxication and instead convicted of the less serious offense of manslaughter. Diminished capacity defenses don't generally lead to acquittal, just conviction on a lesser charge. Some states bar the use of diminished capacity completely.
I don't have exact numbers but off the top of my head I can tell you that easily two-thirds of the prisoners I see have a history of some type of head trauma. They do impulsive things and get into accidents. They wreck their motorcycles and their cars. They get into fights and get the...uh...stuffing beat out of them. Outside of the trauma area they also carry the neurologic sequellae of their lifestyles---alcoholic dementia, HIV dementia, sometimes strokes from untreated hypertension. All this is added onto environmental developmental insults like lead poisoning.
OK, so how does brain injury or neurogic impairment relate to criminal prosecution?
My answer is that there's not much of a relationship, although if the injury is severe enough it could fall into the realm of insanity. The fact of the matter is that there's a big leap between what you see on an MRI or on neuropsych testing and a person's actual functional capacity. The more prisoners I see the more I realize you really don't need to have that many functional neurons to get by in life. When it comes to moral reasoning, you need even less. Child development theorists know that social conscience is usually in place by the age of ten. A basic understanding of Miranda rights can be grasped by anyone with a fifth grade reading level. If there's any real question about it the judge can order a competency assessment to determine mental capacity to stand trial.
This is probably more than anyone needed or wanted to know, but here you have it.
Pass the cookie dough.