There are several theories about how they first came to life. One of them is particularly interesting:
It all began around 4,000 years ago somewhere in China. Back then, people had a lot of questions; Questions that only the heavens could answer. For only the heavens had the power of divination and could foresee whether it was going to rain or if a big disaster lay ahead. So the people sacrificed animals and offered them their bones along with turtle shells. When burned, these shells formed cracks illustrating the heavens’ forecast. Comparing the cracks to real-life things, the people could analyze them and understand the heavens’ messages.
After a while, the people realized that they had discovered a good way to communicate with the heavens and soon receiving messages was not enough for them anymore. So they replicated the cracks and wrote them on unburned turtle shells asking for things they needed.
Many years later, during the Zhou dynasty, these turtle shells were found and then became the foundation of a new writing system in China.
Of course, this was only the beginning. Chinese scribes added a lot of characters or made up new ones when they did not know the original meaning. Moreover, the characters changed over time, simplifying the writing but solidifying their meaning.
By the way, it wasn’t until 500 AD that Kanji came to Japan. Until then, Japanese had not had its own writing system. In other terms, it had been a pure spoken language before that.
Should you want to learn more about Kanji history, here are some sources that you might find interesting: