It was knowlege of the mind. As humans evolved, they learned certain powers that the mind was capable of. It actually came before religion. Originally the knowledged was shared, but later it became more advantageous to keep secret. Those who wanted power and wealth would then have an instant advantage over those who knew nothing about the powers of the Spirit. Also, the need for protection from ones enemies, hence black magick became dominant.