Jim Dunnigan explains:
Despite the many defeats, heavy casualties and even heavier losses from desertion, the Syrian military is still an effective force. This is mainly because the officer corps, or most of it, remained loyal to the Assads. This was particularly true of mid-rank (captains, majors, colonels) officers who are directly responsible for keeping actual combat units (companies, battalions and brigades) intact and operational. A key reason for this loyalty is real estate, or rather a government program that enabled officers to buy apartments or homes in new communities composed mostly of officers families and located near cities. For many officers, who grew up relatively poor in rural areas, getting an education and being selected to be an officer was itself a big deal. But in the 1980s the government began a program that made it easy for an officer to own his own home rather than depending on the cheap, and temporary (for as long as he was in the military) government housing. Owning a home was a big deal to many of these officers, who now had a major financial asset in a place where it was easy to get his kids a good education and exposure to a wider world. The largest of these officer owned housing complexes was outside Damascus. Thus when the war started in 2011 and many officers thought of fleeing the country they had to consider losing their major asset by doing so and the expense of fleeing not to mention the risk of jail if caught deserting in wartime. Enough officers decided to stay to keep the army intact despite four years of heavy fighting and many defeats.
The quality of Assad’s enemies surely plays a part, too. ISIS will never win many hearts or minds, and the non-ISIS opposition so far has lacked the unity to score a knockout win. That, and Moscow has been less shy about giving Assad material assistance than we have been about assisting our friends (assuming we have any) in the opposition alliance.
Mostly though the Assad family is made up of wily operators, otherwise they’d have been exiled or dead or long time ago.