Islamic State fighters who fled into the desert to escape U.S.-backed forces in Syria and Iraq are now drawing on stashed weapons and ammunition to stage renewed attacks in both countries, as friction among foreign powers hampers efforts to finish the terror group off.

The attacks are a sign of Islamic State’s advance planning, and they have complicated the Trump administration’s plans to withdraw U.S. troops. Before retreating from its urban strongholds, Islamic State decentralized its command structure, set up sleeper cells,...