Though there are legends placing the origins of chopsticks as early as the Shang Dynasty (3rd millennium BCE), and indeed some achaeological findings at the site of Yinxu have corroborated those claims, the earliest verifiable textual recording of use of chopsticks (筷子, kuaizi) comes from The Writings of Master Han Fei (韓非子) from the 3rd century BCE (though the name I just used, kuaizi didn't enter the Chinese lexicon until the Ming [14-17 C.]). They were initially simply bronze rods used solely as cooking implements to safely grasp cooking food, manipulate the cooking fire, and service pieces or slices of the meal, not as direct eating implements.
Nevertheless following the adoption of Confucianism in the Warring States Period, and especially by the Han Dynasty (2nd C. BCE - 2nd C. CE), they had widely come to be seen as preferable to implements like forks or knives, since they reflected "[a] gentleness and benevolence, the main moral teaching of Confucianism," as opposed to the knife and forks' violent qualities, and weapon-like design (source). There was likewise the practicality that the blunted rather than edged quality of a pair of chopsticks was (and is) far easier on the delicate lacquerware bowls and dishes favored in China.
As Confucian and Chinese culture and mannerisms flowed into its vassals and satellite states of Korea, Manchuria, Japan, et al, so too came that same ideology favoring chopsticks over bladed or penetrative eating implements... though of course the use of forks, knives et al. always remained common as preparative implements in the kitchen or over the stove. It was nevertheless considered more gentile to use kuaizi than a "warlike" and "barbarous" fork and knife.
And as for the charge that the fork/knife combo is in any way more "practical", that is pure cultural bias seeping through. They're more practical for you because that's what you (and I, and almost all Westerners) are used to... and we feel horribly awkward using two sticks instead. But people with enough practice are capable of using chopsticks with at least as much precision and finesse, and at least as far as I've seen often more, that the ol' fork and knife.
And why didn't they spread to Thailand?
Chinese scholars view the preferred utensil of a place and time in the context of the food it transported from plate to mouth. So evidence of Chinese fork and knife use at Neolithic sites signifies the presence of meat-eaters, apparently upper class, while common people ate cereals and vegetables with the oldest historically documented Chinese utensil set: spoon-and-chopsticks (bizhu 匕箸), with the spoon designated for consumption of cooked grains and chopsticks for everything else.
Although chopsticks do appear in the Confucian canon, Confucius and his disciples probably ate their grains with spoons, in the case of porridge, or their hands, in the case of cakes. The only reference to chopsticks in the Book of Rites designates their application to pluck individual vegetables from stew, a task for which chopsticks are (arguably) better suited than either a fork or a spoon.
The mythical origins of chopsticks imply a certain rugged practicality. The Great Yu, founder of the Xia dynasty (2100-1600 BCE), needed to eat in a hurry so he could coordinate the emergency response to a rising flood, so he snarfed a quick meal with the help of two twigs he found lying around. Eureka!
Chopsticks only began to outcompete the spoon in the realm of grain foods with the development of wet cereals in the south, specifically glutinous rice strains that clump together when pinched. Widespread adoption of chopsticks for eating the grain foods of the north, dry cereals like barley and millet, took longer, but approximately track with the appearance of millstones, which pop up in Han tombs around 100 BCE. Why? Noodles. Specifically, soup noodles, which you can't very well eat with a spoon. Forks would do the job, but by this point in Chinese history, the fork is not a table-top utensil.
Interestingly, you do find knife-and-chopstick sets among hinterland cultures, specifically herding or hunting people who need their knives to carve hunks of meat, and their chopsticks for noodles and veggies. When the Manchus overthrow the Ming in 1644, they bring forks and knives back to elite table settings, although by that time chopsticks are so firmly entrenched in Chinese civilization, the traditional Manchu table manners only survive a few generations before being supplanted by chopsticks, despite an imperial-sponsored public service campaign in defense of the knife.