I think a more specific denominator you might wanna look into is free energy minimization as you mention in your first example. I really liked reading Active Inference and What Is Life? on the subject.