Bar magnets work based on the principles of magnetism.
1. Magnetic Field
A bar magnet has multiple magnetic fields on its surface. A magnetic field is the area in space where a magnet exerts a force on other magnetic materials or moving charged particles. The magnetic field lines of a bar magnet are related to the number of magnets embedded in it. The more magnets embedded in it, the more magnetic field lines there are on the surface. You can visualize these field lines using iron filings. When you sprinkle iron filings around a bar magnet, they will align along the magnetic field lines, showing the shape and direction of the field.

The strength of the magnetic field is not uniform around the bar magnet. It is strongest near the poles and gets weaker as you move away from the poles. The magnetic field also has a direction. By convention, the field lines point from the north pole to the south pole outside the magnet and from the south pole to the north pole inside the magnet.

2. Interaction with Other Magnetic Materials
When a magnetic material (such as iron, nickel, or cobalt) is brought close to a bar magnet, the magnetic domains within the material align with the magnetic field of the bar magnet. Magnetic domains are small regions within a magnetic material where the magnetic moments of atoms are aligned. In an un - magnetized piece of iron, for example, these domains are randomly oriented. But when it comes into contact with a bar magnet's field, the domains rotate and align in the direction of the bar magnet's field, causing the material to be attracted to the bar magnet.

If you have two magnets, like poles (north - north or south - south) will repel each other, and opposite poles (north - south) will attract each other. This is because the magnetic field lines interact in such a way that when the fields are in the same direction (like poles), a repulsive force is generated, and when the fields are in opposite directions (opposite poles), an attractive force is generated.
3. Magnetic Induction
A bar magnet can also induce magnetism in a non - magnetic material. When a non - magnetic conductor, like a copper rod, is moved through the magnetic field of a bar magnet, an electric current can be induced in the conductor according to Faraday's law of electromagnetic induction. This shows the close relationship between magnetism and electricity and is the basis for many electrical generators and motors that use magnets, including bar magnets.





