So permanent magnetic materials are termed ferromagnetic. It is a good question to ask what the nature of the force is between two magnets, but I believe the answer is: we don't know.
Take as a similar type of example: electric charges. We know that like electrical charges repel one another and unlike charges attract, and we have an equation which we can use to calculate the resultant force (Coulomb's law).
But as to why it is so that like charges repel and unlike charges attract, we can only say that the fields created by these charges interact in such a way as to make this true.
The same with magnets. The magnetic field surrounding magnets will interact in such a way as to make like poles repel and unlike poles attract.
Perhaps someone who is versed in QED can tell us if that theory shines any stronger light on this.