I don't treat MBTI as a valid personality test.
However it was based on Carl Jung's book "Psychological Types".
In this book he describes how Thinking, emotions, sensations and imaginations are internalised or extracted from the environment. He defines 8 psychological functions that exist within every human's mind and then explains how it affects a person's behaviour. He also tries to analyze the personalities of various artists , philosophers and lords using this system.
https://www.cyjack.com/cognition/(ebook%20pdf)%20jung,%20carl%20-%20the%20psychological%20types.pdf