Things interact according to their nature.
Mass generates gravitational pull, electric charge produces electrostatic forces, a moving electric charge gives birth to a magnetic field… hydrogen is ‘infatuated’ with chlorine, white phosphorus is so keen to combine itself with oxygen that it actually behaves indecently if not ‘modestly’ hidden in water… sex is the driving force which sets the animal world in motion… while survival instinct, however powerful, is, sometimes, overcome by altruism.
Meanwhile rules are just a figment of human awareness interacting with observable interaction between things.
And no, the ‘simple’ ability to learn is not sufficient, by itself, to generate rules. The rats in Rat Park were quick to figure out how to get a ‘fix’ of morphine but that didn’t mean they had ‘discovered’ any rule…
For that to happen, the ‘ruler’ needs to be able to watch from ‘above’. From ‘outside’ the interaction.
And this is why we find it easier to study other persons. Preferably strangers. ‘The doctor who treats himself has a fool for a patient’. Simply because our ability to watch ourselves from outside – and to compartmentalize knowledge, is real but severely limited.
Yet, limited as it is, it’s powerful enough to help us generate rules.