In Palmyra and Ramadi, Iraq, the Islamic State carried out a strategy of attrition, weakening the opposition for a crushing strike.