What a thing actually does, as observed. Behaviour is the only part of a system anyone outside it can see.
Middle English behaven (to conduct oneself), from be- (thoroughly) + haven (to have, to hold), reflexively 'to hold oneself [in a certain way]'; the noun follows in the 15th century.
Names what a person or a system does as observed from outside, apart from what was intended — the one layer anyone but the actor can actually check.