Magnets are used as poles in DC generators, motors, Altenators, solenoids etc. They are essentially formed by stacking the laminations made from magnetic material. after stacking up the cores with different shapes as per the requirement, they are magnetised by separate excitation methods to impart magnetism and polarity to the stacks. Thats how the magnets are formed with certain of magnetic density and hystersis loop to store magnetic power. The reverse process of it is called the demagnetisation. the same stack is subjected to reverse polarity magnetic excitation so that it looses all its magnetism and becomes demagnetised. This process is called demagnetisation