Like many things, the history of tea begins the first time it was recorded, but what we can be sure of is of an untold story long before man started putting pen to paper. It's also worth keeping in mind that just because something is written down, doesn't necessarily make it true, and we know just that to be very true in today's day and digital age. Sometimes people record incorrect information based on a Chinese Whisper (pun not intended), and sometimes events take place beyond the radar of the pen (or keyboard). Real history is usually made when and where no one is looking.
Having established this, the earliest published book on Tea is The Classic Of Tea, by Lu Yu. It dates back to the 7th century, and while a few copies of it exist, it is hard to get a hold of. We managed to secure a second-hand copy that had to be shipped over all the way from Jamaica!
While there aren't many records and only legends exist of the first few thousand pre-historical of tea consumption, it wasn't until the Tang Dynasty (618-907 CE) that the story of tea started becoming a topic to read about in books. Prior to this, there were scattered mentions dating all the way to the Zhou Dynasty (circa 1112-256BC).
Popular legends suggest that the Chinese Emperor Shennong discovered tea in 2737 BC, when a leaf of Cammelia Sinensis fell into some water the emperor was boiling. Others suggest it fell into his cup. Dispite the disputed narratives, the one thing everyone can agree on that tea is deeply rooted in Chinese history and culture. The beverage is considered one of the 7 neccessities of Chinese life, along with firewood, rice, salt, oil, sauce and vinegar.
If we put together all the pieces from literature, drawings, and legends, it is clear that man first plucked and steeped tea leaves with the intent of use as medication. One can assume that the Shamans of China recognized the dietary benefits of tea as promoting mental clarity and physical longevity. Some texts even suggest the use of tea leaves ground up into a paste to alleviate rashes and rheumatic pains. Tea was perceived to have healing properties then, and it is perceived to have healing properties still. The rest is history.