Children (minors and the "age of majority") and age of consent is defined by law. While we have come mostly to an agreement on the age of consent for many things, nothing prevents us from changing our definitions or age of consent for varying activities.
The age at which the brain is capable of the higher levels of executive function necessary to make rational, informed decisions (not saying that such decisions are guaranteed, just that the brain is capable of considering them) is a function of biology, i.e. defined by natural law.
The legal framework of consenting age protects the abuse of a minor's inability to "think like a grown up", though it's arguable if the age of consent is too low (because biology dictates an older brain has a matured executive function capacity) or too high (because some kids, as many can attest, are wise beyond their years).
Children (minors and the "age of majority") and age of consent is defined by law. While we have come mostly to an agreement on the age of consent for many things, nothing prevents us from changing our definitions or age of consent for varying activities.