Especially in regards to the Tang and Han, I've heard the Song were far less of a military power and were incapable of reconquering many lands held by these previous dynasties. If this is true, why might this be the case?
The Song Dynasty was not necessarily weak compared to previous dynasties, since it also saw rockets, cannons, landmines, flamethrowers, and other weaponry that we would more expect to see in Renaissance Europe, a couple centuries later. However, the Song was unable to fully unite China proper (see my next paragraph about the Western Regions and my third paragraph about the Yan-Yun Sixteen Prefectures), and then was forced southwards later on. There are many possible factors. The most popular theories focus on the dearth of suitable horses, a "gap" in the Great Wall, and an overly centralized military structure
If you compare maps of the Song Dynasty with maps of the [Han](https://upload.wikimedia.org/wikipedia/commons/0/05/汉朝行政区划(简).png) and Tang, you'll see that the empire is conspicuously missing a northwestern arm (modern-day Xinjiang) often known as the Western Regions by the Chinese. Instead, it is occupied by the Tangut kingdom of Xi Xia. Without control of that region, the Song Dynasty (Northern Song: 960 to 1127; Southern Song: 1127 to 1279) struggled to get enough quality horses to build a cavalry force that could counter the nomadic forces of its 3 enemies to the north: the Khitans (916 to 1125), the subsequent Jurchens (1115 to 1234), and finally the Mongols (1206 to 1368). The Song infantry developed many anti-cavalry tactics and weaponry, but they simply could not match the speed of the cavalry, which excelled in the flat plains of northern China
As for the "gap" in the Great Wall, the Yan-Yun Sixteen Prefectures were controlled by the Khitan, the first nomadic adversaries of the Song. Those prefectures include modern Beijing, Tianjin, and Datong, a sizable piece of land south of the Great Wall. As a result, the Great Wall constantly "leaked" enemy cavalry. Song forces could win battle after battle, and yet never fully contain the threat because the enemy could simply ride off to attack elsewhere. Once the Jurchens overthrew the Khitan, they poured through that gap and took northern China, forcing the Song court southwards. The Mongols would later ally with the Song to destroy the Jurchens, but a territorial dispute led to war, and the Mongols quickly took over the Henan area, which is also flat. South of that is where the rivers, lakes, and mountains finally allow Chinese infantry and marines and sailors to take the upper hand
In my mind, however, the single most significant factor is the heavy centralization of military power. The Song Dynasty emerged from a chaotic period full of coups and warlords. To prevent regional rebellions, the Song adopted a policy of regularly rotating commanders and issuing orders from the capital. As a result, the commanders often were unfamiliar with local terrain and troops, and the orders would sometimes arrive too late. Other Chinese dynasties already struggled with northern nomads running amok, but without significant numbers of quality horses from the Western Regions and a large gap in the traditional border defenses of the Great Wall, the Song Dynasty was already at a disadvantage. The issues with supply, logistics, terrain, cohesion, and communication all conspired against Northern Song attempts to unite China proper and close the Great Wall. Eventually, the capital of Kaifeng fell, and Southern Song attempts to recover northern China were limited by the same issues. In fact, throughout Chinese history, only twice has a Northern Expedition succeeded. Most dynastic wars ended with the northern force pushing down into southern China