Mountains are the worst surface on the planet Earth for the U.S. military to engage in battle on. Line of sight is not only blocked, but it is blocked by solid ground. Solid ground deflects the concussion of explosions, the flight of bullets and shrapnel. Solid ground deflects electronic detection. Within mountain terrain, it is easy to hide weapons and troops. Non-mechanized forces can maneuver better with interdiction far more difficult and less likely. The uneven ground makes heavy weapons less effective. Firepower effectiveness is reduced. Aircraft are far less effective. It is much more difficult to identify the target and the 3rd dimension is restricted. (This is one of aircraft’s largest advantages.) Supply is more difficult and cumbersome. This makes any deployment far more expensive and requires a force multiplier that is much higher than anywhere else.
Afghanistan also has a large difference in culture. Afghanistan has a tradition of resistance, and a more established Islamic way of life. Iraq has Iran and Syria as neighbors to funnel supply and troops to the enemy. Afghanistan has Iran and Pakistan. Compared to Syria, Pakistan is a far more effective base to supply an insurgency from, for a number of reasons.
Pakistan has nuclear weapons and a much larger military than Syria. Pakistan’s population is much larger than Syria, so they can support a much larger army. This applies to both uniformed and irregular troops. Pakistan’s economy is much larger, so it can function as a larger supply base. Pakistan has a history of helping Islamic causes in both Afghanistan and Kashmir. Syria has been involved in Lebanon, so all parties have two front wars. Pakistan is a far more dangerous neighbor than Syria, both physically and ideologically.
This all adds up to a far more difficult proposition when dealing with Afghanistan.