The gunpowder is provided by a friend of the woman being executed. The executioner agrees to tie it around her neck just before the fire is lit.
Would this be Anne Askew, by any chance? I couldn't get into Tudors, but she's the right time frame for parts of the show, she's famous and awesome, and according to Foxe's Acts and Monuments (aka Book of Martyrs), they indeed tied a bag of gunpowder around her neck at her execution:
Before the fire should be set unto them, one of the bench, hearing that they had gunpowder about them, and being alarmed lest the faggots, by strength of the gunpowder, would come flying about their ears, began to be afraid...Then Wriothesley, lord chancellor, sent to Anne Askew letters, offering to her the king's pardon if she would recant; who, refusing once to look upon them, made this answer again, that she came not thither to deny her Lord and Master...Whereupon the lord mayor, commanding fire to be put unto them, cried with a loud voice, Fiat justitia [let there be justice].
The point was that the flames would reach the gunpowder and set it off (explode it), killing her quickly instead of the slow, torturous death of burning.
Late medieval and early modern executioners actually developed a number of ways to kill condemned people more quickly, so they would resist/suffer less (...the distinction is not always clear) while still giving the appearance of spectacle to the crowds, for blood, for entertainment, for the lesson not to end up this way. For burnings, gunpowder was one option, secret garroting while tying the person to the stake was another. In Germany, women sentenced to be buried alive were often sometimes killed with a stake through the chest before the burying (where they would otherwise die slowly and thrashingly from suffocation).
Sometimes.
Execution records make it clear these things were graces--favors, mercies--NOT required or even standard.
If you're interested, you can also read Askew's utterly badass, firsthand account (filtered through Foxe) of her interrogation under torture, in which she schools her captors in religion while arguing that women can and should be allowed to read Scripture.
Related question: In that moment when they light the fire and they are waiting for it to reach the person and then become hot enough to kill... there must have been an awkward lull in the event. What happened, did someone keep making speeches or did everyone stand there silently waiting for the screaming to begin?