Esotericism is the idea that some spiritual teachings should be kept secret from the majority and only be revealed to a select few. The Upaniṣads, which were composed around the time of the Buddha, were secret teachings only made available to high caste people who pledged total loyalty to the teacher.
Even in Tibetan Buddhism or Vajrayāna, some teachings are reserved only for those who have been initiated. The idea that the Dhamma should be restricted to or monopolized by an ‘in-group’ was repugnant to the Buddha.
He perceived the truths he taught as being understandable to all, relevant to all and applicable to all. On one occasion he said: ‘Three things shine openly, not in secret. What three?
The orb of the moon, the orb of the sun and the Dhamma and discipline taught by the Tathāgata’ (A.I,283). He reiterated this same point just before his final passing when he said: ‘I have proclaimed the Dhamma without any idea of a hidden and open teaching. I do not have the closed fist of the teacher who holds anything back.’ (D.II,100).