Just before the Buddha’s passing, he told his followers that everything he knows has been taught to them. However, he taught them orally, that is, he left no writings behind. While his followers did their best to continue the oral tradition of the teaching (an expression of impermanence) they eventually decided to put what he taught down in writing.
The written teachings became known as the Tripitaka or ‘three baskets’. The baskets consisted of rules of the community (sangha) are called the jataka. The “actual” words of the Buddha were called the sutras. And the commentaries are called the abhidharma. These were confirmed and laid down over several “councils”. The most important writings are the sutras. The Pali Canon consists of five divisions. They are 1) the long discourses (Digha Nikaya), 2) middle length discourses (Majjhima Nikaya), 3) the connected discourses, 4) the numerical discourses, and 5) the miscellaneous collections. In these, we get a sense of the time of the Buddha, the culture and society to which he belonged. Sometimes these are the only written records we have of this place and period.
The Pali Canon, being the oldest collection, is considered the most authentic. But these are not the only writings. From around the 1st Century CE, we see a new set of writings appear, those in Sanskrit – Mahayana sutras. These were developed in the North-West of the Indian sub-continent in present-day Pakistan and Afghanistan. Different from the Pali they were less concerned with the Historical Buddha than with the spiritual or Transcendental Buddha. The settings for his discourses in these are generally in celestial realms and concern deeper more abstract aspects of Buddhism. Furthermore, they develop upon the earlier teachings in ways that are beyond the contents in the Pali Canon.
Eventually, this led to the main divergence of Theravada (also derogatorily called “Hinayana”) and Mahayana Buddhism. The Theravada stresses the arhat ideal, which sees striving for one’s own enlightenment is important. Whereas the Mahayana chooses to stress helping others (the Bodhidharma ideal) to reach enlightenment. The Mahayana also uses emptiness over the term non-self where the nature of impermanence is extended to everything (though I do not think the Buddha had meant to limit the non-self to just beings).
Eventually, the various Buddhist schools developed their own texts. For example, the Dhammapada is popular with Theravadins. The Japanese Jodo Shin Buddhism takes the Tannisho by Shiran as an important exposition of their position. And Zen Buddhism has its Mumonkan (koans), art (Sengai and Enku), poetry (Basho, Buson, and Issa) and commentaries (Dogen and Hakuin). The abundance and variety of writing in Buddhism cannot be stressed more.