The central plains produced tea and needed horses; the frontier bred horses and needed tea. The tea-horse trade took shape from this match: the central plains gave tea for frontier horses, under government management, and it also helped keep the border settled.
In the middle of the Tang, Uyghur envoys came driving horses to trade for tea, and the frontier exchange of tea for horses began there, spreading to Tibet as tea entered the plateau.
In 1074 (Xining 7 of the Northern Song) the court set up a Tea and Horse Agency in Chengdu to trade state tea specifically for Tibetan horses, and the tea-horse trade became an established system.
In 1735 (Yongzheng 13) the Qing stopped buying horses with tea in Gansu, and the official tea-horse trade ended. The tea-horse agencies became tea agencies, and by 1760 (Qianlong 25) the last of them, at Taozhou, had been closed.
The Tea-Horse Frontier Trade is the class in the chapter on Commerce on the trade of tea for horses: the state-run border trade in which the central plains exchanged tea for frontier horses, from the Tang to the Qing. Uyghurs drove horses to trade for tea in the Tang, the Northern Song set up a tea-horse agency to exchange state tea for Tibetan horses, and the official trade ended in the Yongzheng reign of the Qing. It supplied each side with what it lacked and also helped keep the border settled.