Magnetism Reasonings

What is the reason behind magnetic properties of materials?