I hear and read this phrase used in a tone suggestive of payback and glee at vengeful justice being served. Sort of like Hamlet saying, “Tis sport to have the engineer hoist by his own petard”, but more rustic and American-sounding.
So… Why “them apples” instead of “those apples”? Why apples and not pears?
A petard was a medieval explosive device, commonly used to breach gates or walls when assaulting a castle. To be hoist by one’s own petard means you have fallen into your own trap. In this context, “hoist” means to be lifted, or blown up.
A petard was an explosive charge, used in medeval times to blow up doors and ramparts on castles that were being attacked. As medeval seige engineers hadn’t figured out how to make remote controls, the practice was to place the charge, light it, and run the hell away before it blew up.
Needless to say, occasionally you wouldn’t make it quite out of the blast radius before the charge went off, and you might end up “hoist” (thrown up into the air) by your own petard.
As it makes a pretty amusing and apt metaphor for being undone by one’s own scheme, it passed into the language as a regular phrase.
The term “meme” itself is now something of a meme. Why, I even use the word now when warming up my singing voice. “Meme, meme, meme, meme…”
Joking aside, and as the OP who usd the term in the title of the post, I thought one of the core concepts of the term “meme” was to embody “something that is culturally transmitted but exhibits properties of genetic recombination and mutation”. And language use is usually cited as a primary means of transmitting memes. I would assume etymology is therefore essentially trying to do comparative memetics, to find a “common ancestor” just as one may compare genetic material between related species.
It’s using “meme” to describe something like, “where’d people get the stereotype of the girls who like guys who are jerks to them” that doesn’t make sense to me.