When an adult tells a kid not to do “X” and they do “X” would be called Psychological Reactance. It’s one of the simplest examples (along with one of the easiest to perform) you’ve probably seen. Why would someone do the opposite of what they were told in the first place? To keep their personal perception of freedom. To keep their belief by doing the opposite of what was suggested.
Psychological reactance is both mental and behavioural. The subject mentally processes the given options, and their behaviours are observable. Psychological reactance is only triggered if the subject’s freedom is threatened or has legitimate reasoning to respond.