Tang interference and failure and Silla picking up the pieces, in essence. Korea was hard for the Chinese to control (or the Mongols, later) but they could stir things up and the Koreans were good at picking up the pieces.
Paleolithic excavations show that humans inhabited the Korean Peninsula half a million years ago, but most scholars assume that present-day Koreans are not descended from these early inhabitants. Neolithic age (from 4,000-3,000 B.C.) humans also inhabited the area, identified archaeologically by the ground and polished stone tools and pottery they left to posterity. Around 2,000 B.C., a new pottery culture spread into Korea from China. These people practiced agriculture in a settled communal life, and are widely supposed to have had consanguineous clans as their basic social grouping. Korean historians in modern times sometimes assume that the clan leadership systems characterized by councils of nobles (hwabaek) that emerged in the subsequent Silla period can be traced back to these neolithic peoples, and that a mythical "child of the sn," an original Korean, also was born then. There is no hard evidence, however, to support such beginnings for the Korean people.
By the fourth century B.C., a number of walled-town states on the peninsula had survived long enough to come to the attention of China. The most illustrious of these states was Old Chosn, which had established itself along the banks of the Liao and the Taedong rivers in southern Manchuria and northwestern Korea. Old Chosn prospered as a civilization based on bronze culture and a political federation of many walled towns; the federation, judging from Chinese accounts, was formidable to the point of arrogance. Riding horses and deploying bronze weapons, the Chosn people extended their influence to the north, taking most of the Liaodong Basin. But the rising power of the north China state of Yen (1122-255 B.C.) checked Chosn's growth and eventually pushed it back to territory south of the Ch'ngch'n River, located midway between the Yalu and Taedong rivers. As the Yen gave way in China to the Qin (221-207 B.C.) and the Han dynasties (206 B.C.-A.D. 220), Chosn declined, and refugee populations migrated eastward. Out of this milieu, emerged Wiman, a man who assumed the kingship of Chosn sometime between 194 and 180 B.C. The Kingdom of Wiman Chosn melded Chinese influence, and under the Old Chosn federated structure--apparently reinvigorated under Wiman--the state again expanded over hundreds of kilometers of territory. Its ambitions ran up against a Han invasion, however, and Wiman Chosn fell in 108 B.C.