As far as I know, ifrits are cursed, evil djinns that have become demons. They grant wishes, but in reverse.
Another theory (most likely, I will use it as a basis for further development)
A Warlock, using powerful magic, combines the spirit of a demon and the essence of a djinn, which is why ifrits look so much like djinns, but are not djinns themselves, + it also explains why they love fire so much, and not the original magic, and of course, the story of the mage Rashka fits perfectly into this concept of the ifrit.