This saying, along with variants like Nothing in excess, Moderation in all things and Measure in all, affirms the importance of temperance (Gr: sophrosyne). Temperance is one of the four cardinal virtues.
Temperance means that one can stand above ones thoughts, passions and actions and moderate (temper) them. When we mindfully moderate thoughts and actions, we use a kind of transcendental consciousness, something above the ordinary ego.
One way to develop this transcendental consciousness is by introspection. Hence Plato saw this saying and Know Thyself as similar in meaning (Charmides, 164d).