Magnets can be broadly classified into two types
Electromagnets or temporary magnets and
Permanent Magnets
Electromagnets are made by coiling a conductor around a magnetic material such as soft iron. The Electromagnet gets magnetized when current flows through the conductor and gets demagnetized when it stops. Electromagnets find extensive use in relays, cranes, in solenoid valves, etc. These magnets are characterised by low retentivity.
Permanent Magnets are magnets which retain magnetism even after the magnetizing field strength is removed. Permanent magnets are used in equipments such as speakers, data storage devices, generators, etc, etc.
While Permanent magnets too get magnetized the same way as electromagnets, they are made of special material which have very high retentivity which enable them to retain magnetism long after the magnetizing field is removed. The first permanent magnets were made from magnetite, an ore of iron which gets naturally magnetized by the earth's magnetic field.
Later, better materials such as Alnico (an alloy of Aluminium, Nickel and Cobalt) were used.
The 1970s saw the development of ceramic materials such as barium ferrite and strontium ferrite . These materials have the advantage of high formability, i.e. they can be made into any shape and size without the need for expensive machining. These magnets can also be made flexible adding the ceramic powder in a binding material such as PVC or rubber.
For applications such as the headphones for music systems, smaller and more powerful magnets are required. These magnets are made from a material known as samarium cobalt(SmCo).
Neodymium magnets are also similar to SmCo magnets, however they are cheaper. Neodymium magnets are widely used in computer hard disks. These magnets are the strongest magnets which are commercially used.