Why does a compass needle get deflected when brought closer to a bar magnet?
When the compass is brought closer to a bar magnet then due to magnetic force its magnetic field line intersects with the bar magnet. Thus, the compass needle gets deflected.