AL-YAROUBIYAH, Syria—Plumes of black smoke billow on the horizon of this border town in northeast Syria, a thumb-shaped corner of the country that pokes into neighboring Turkey and Iraq.

The smoke isn’t from war, but it rises from the deadly fight over resources between Islamic State and Kurdish fighters. Men, women and children operate thousands of primitive metal kilns to refine crude oil distributed by the warring sides to buy loyalty. Residents sell the fuel they make to black-market traders.

...