Firstly, in terms of Empire size the Tang was not the largest in Chinese history - that honor belongs to the Qing (or Yuan).
Couple of reasons:
1) Most importantly: legacy of the Sui, the 38-year dynasty that preceded China. The Sui not only unified China and put an end to a 300-year-long unrest, but it also made the realm more productive as a whole. Emperor Wen of Sui's 'recovery' policies stored huge surpluses which his son, Emperor Yang, used for massive projects such as the refurbishment of the Guanzhong region (Luoyang), and the building of the Grand Canal. Such projects caused unrest which eventually brought down the Sui, but it provided an ideal foundation for the Tang economy (greater north-south integration, revitalization of the critical Wei River Valley), which China could use as influence against its periphery.
2) Tang open-ness: the Tang were rather open as a culture (maybe because the Li clan was semi-Turkic), and under their rule China was relatively open to foreigners. There's the standard 'tolerance of religions' edicts, Arab enclaves in the southern ports etc., but more importantly the Tang was pretty open to non-Han holding government positions, even military positions. For example, An Lushan, the most famous Tang military commander or jiedushi (for all the wrong reasons), was half-Sogdian. Epitaph research for the Tang also demonstrates the existence of Tibetan commanders and so on. Evidently if you're willing to include foreigners in your hierarchy you have a better chance of bringing said foreigners under your rule.
3) Nomadic weakness: traditionally the greatest limiting factor for Chinese military power came from the steppe nomads, which if unified could cause massive headaches for Emperors (as they did during the Song and Ming). The dominant steppe power during the Sui-Tang period was the Gokturk Khanate, which during the Sui Dynasty had split into two warring halves. Various future steppe powers, such as the Jurchens or the Khitans, were not yet capable of filling in the void. This left a strategic vacuum in both Mongolia and East Turkestan, which the Tang Dynasty could easily fill in with little effort.
4) Tang governance: unlike the traditional view of Imperial Chinese governance, pre-Song China was largely governed by aristocrats who derived their influence from extensive estates in their place of origin - kind of like the UK during the 18thC, I suppose. Normally this is a recipe for disaster, as local notables gradually become independent of central authority and become powers in their own right (a major contributor of unrest during the period between the Han and Sui).
Various reforms in the Tang and Sui helped re-focus power back in the hands of the Central Government, such as the examinations system (which was still largely dominated by the aristocracy during this period), the elevation of the Imperial capital as a place for the rich and powerful to live, and a clearer delineation of the Emperor's responsibilities vis-à-vis his aristocratic officials. As such, the Tang avoided the short-and-powerless fate of its predecessor dynasties.
5) Tang culture: part of what made the Tang 'great' was the explosion of culture that happened during the period, with poets such as Li Bai, Du Fu, and so on. In a sense this phenomenon was a result of Tang openness (and also the fact that imperial examinations included literary tests), with increased contact with foreign cultural output forcing changes in how China developed its own literary form. Chief among this was the abandonment of the extremely formulaic and conservative pianwen form, the dominant literary output during the Northern and Southern Dynasties, for more free-wheeling, 'Romantic' poetry as exemplified by Li Bai and the others. Similarly, the flowering of Buddhism during this period and subsequent increased contact with India also wrought changes to Tang sculpture and painting, for example in the Mogao Grottoes in Dunhuang.
Basically, the Tang inherited a realm of vast potential from the Sui, and enhanced it further through a liberal willingness to engage with its periphery, an attitude reinforced by the fact that it experienced no real peer competition during the period. No other Chinese dynasty has been so lucky before or since.