They unfortunately do, but at that age the brain is still partially goo:
According to the National Organization of Victims of Juvenile Murderers, cognitive function develops concrete to abstract between the ages of 12 and 15. This means that a person can genuinely understand that specific behavior brings specific consequences. However, research has shown that a teenager’s brain does not resemble an adult’s fully matured brain until they reach their early 20’s. Source: Google’s summary for "has a 12 year old brain developed enpugh to understand murder