In the early 1700s, a manager/actor named John Dennis invented a machine that made stage thunder which he used in one of his plays. Apparently, he wasn't a very good playwright and the play wasn't open for very long. It was closed and replaced by a production of
Macbeth staged by another company. Dennis went to opening night and was outraged to hear his own thunder machine being used in the play. He jumped up and yelled, "That is my thunder, by God; the villains will not play my play , but they steal my thunder!" His words have also been reported as "That is my thunder, by God; the villains will play my thunder, but not my play!"
Whatever the actual words were, the phrase came in to being, meaning
to take away the effect of someone's remarks or actions, or
to appropriate someone's idea or claim to fame.