A tiny magnet serves as the compass needle. When a compass needle is brought close to a bar magnet, the compass needle’s magnetic field lines interact with the bar magnet’s magnetic field lines. Thus, causing the compass needle to deflect.
Why does a compass needle get deflected when brought near a bar magnet?
Why does a compass needle get deflected when brought near a bar magnet?