It's a more-than-reasonable question, given the 1965 Nobel Prize winner and physicist,
Richard Feynman's non-answer to the question, which he was said to have repeated regularly to his classes, wherein he claimed it was an
unknown. In a 1986 interview Feynman said, "
The magnetic forces are related to the electrical forces very intimately. That our relationship between the gravity forces and the electrical forces remains unknown, and so on, but I really can't do a good job--any job--of explaining magnetic force in terms of something else that you're more familiar with because I don't understand it in terms of anything else that you're more familiar with." Ken Wheeler has written what he calls by far and away the most complete book on magnetism ever written, I believe.
He's forthright in his claim to know, very completely, how magnets work. His book, "Uncovering the Secrets of Magnetism" 4th Edition, is free and available on the Internet. See for yourself.