First, a little history -- The Insane Clown Posse once infamously pondered how Magnets might function: http://knowyourmeme.com/memes/fcking-magnets-how-do-they-work
The genius of Richard Feynman was asked a similar question in 'Fun to Imagine' 4: Magnets, and he struggles to explain it in lay terms. But it's a great look at what each of us must bring to the table to understand an answer.
In summary: Physics is hard -- but, WHY it is hard has an interesting answer.
Our understanding of the electromagnetic force is described in detail in the equation that represents the Standard Model of physics. To really understand Electromagnetism would require that you undertake understanding that equation.
But I think that understanding that it is the result of an alignment of many atomic spins in the material and all those tiny forces add up is a pretty good start.
I also found a nice mathematical explanation on Quora.
If you know of a very insightful resource for this let us know!