Answer:
magnetic fields
Step-by-step explanation:
compass needle itself is a magnet . It aligns itself along the earth's magnetic fields to show north south direction. When some metal piece is put near a compass needle , it tends to attract the metal piece as metal is a magnetic material . So it gets deflected from its original orientation. So magnetic field around the needle is responsible for its deflection.