The molecular theory of magnetism was given by Weber and modified later by Ewing. According to that theory -
Each molecule of a substance is a complete magnet in itself. Though, in a magnetized atom the molecular magnets are randomly oriented to give zero net magnetic moment. On magnetizing, the molecular magnets are realigned in a particular direction leading to a net magnetic moment.