Mnemonic devices work because the human mind is tremendously adept at remembering certain types of information (such as visualized images, positions in space, lewd and sexy stuff, bizarre and crazy stuff, emotionally evocative or traumatic events, plot lines of stories, etc.) - and pretty bad at remembering other types of information (long strings of numbers, dates, musical scales, etc.). When you use a mnemonic device, you're consciously making an effort to translate information you want to remember into a form that the human mind can easily recall on demand.
For example, most people who memorize and regurgitate sequences of playing cards from one or more shuffled decks for a memory competition (or for making bank at card games) are not inherently more talented at remembering the abstract information of KING OF SPADES, ACE OF HEARTS, FOUR OF DIAMONDS, etc. Instead, they associate each card's suit and rank to a symbol with special meaning to them, such as famous people or their loved ones. They then create a story involving these images interacting with each other in the same order that the cards they represent are dealt from the deck. To their brains, following a creative story with evocative characters and actions is much easier than following sequences of abstract numbers and suit symbols. The truly difficult part is creating a system for translating each card into a distinct image, and then practicing the translation to yourself beforehand so that it becomes second nature.
Strongly recommend that you check out the following links for more info if you're interested.
http://www.ludism.org/mentat/MemoryTechniquehttps://artofmemory.com/blog/https://artofmemory.com/wiki/Main_Pagehttps://en.wikipedia.org/wiki/Method_of_loci