This best illustrates "Thorndike's Law of Effect"
In 1905 this psychological principle was presented by Edward Thorndike that if
an acts generates an effect which results in pleasure the act will be repeated
and if it does not result in pleasurable consequences, the act will not be
repeated. Edward Thorndike advanced this by experimenting on animals by creating puzzle
boxes and escaping from them.