Once upon a time, there was a playwright called John Dennis (well, from 1658 to 1734 to be precise). In 1709 he wrote a play called Appius and Virginia. I can't find out much about that play, but I assume that it was just a reworking of John Webster's one of a century before. Anyway, the important points are first that the play was rubbish, and second that it had a storm scene in it and required thunder, or at least the sound of it.
Now, thunder used to be simulated by rolling iron balls around in a big bowl (the same method used to make mustard). Here's a footnote from a 1750s edition of the Dunciad:
The old way of making Thunder and Mustard were the same; but since, it is more advantageously performed by trough of wood with stops in them. Whether Mr. Dennis was the inventor of that improvement, I know not;
By all accounts he must have been. Because there are three versions of the same story. That footnote continues:
but it is certain, that being once at a Tragedy of a new author, he fell into such a great passion at hearing some, and cried, "'Sdeath! that is my Thunder."
You see, Dennis invented a brand new method of making thunder for his production of Appius and Virginia. But though the acoustic method was good, the play was a bunch of crap. Appius and Virginia closed very quickly. This hurt. But when Dennis went to the same theatre the next week to watch Macbeth (by most accounts), damn it all if they hadn't kept his brand new method while cancelling his play.
But the Oxford Dictionary of Quotations has:
Damn them! They will not let my play run, but they will steal my thunder!
And that, my dears, is where stealing somebody's thunder comes from.
The Inky Fool's mobile was acting up again.