I notice from this question that the moments at joint connection are somehow "conserved", or being "transferred" from one element to the others. In other words, there are no "missing moment".
Note that at joint for left image:
$$2.767\text{ kNm}=(2.37+0.397)\text{ kNm}$$
And for bending moment diagram that I examined so far (using structural software), this seems to be always the case.
So I wonder whether this relationship is true for all kinds of joint connection? Or is there a deeper physics principle behind it (such as the conservation of energy)? How can we derive it from the first physics principle, if it there is a first principle?