Well, 2 ways to achieve it. the first way is deliberate, tapping the fuel lines into the exhaust and putting an igniter near the exhaust tip
The other way (or rather not a way but a reason for the flame) is a BOV. when the car boosts, the MAP sensor detects X amount of air going into the engine. When the BOV does its job of releasing air (Y amount), the amount of air is now X-Y cos the map is located before the BOV.
Now there is too much fuel for too little air. The excess goes into the exhaust and ignites when there is sufficient air, usually after the muffler.