The deflection of magnetic compass is due to magnetic effect of current. When the current passes through conductor then magnetic field is produced it and deflects.
The compass needle is a small magnet. That's why when a compass needle is brought near a bar magnet, its magnetic field lines interact with that of the bar magnet. Hence, a compass needle gets deflected near the magnet bar. In navigation manuals, magnetic deviation refers specifically to compass error caused by magnetized iron within a ship or aircraft. This iron has a mixture of permanent magnetization and an induced (temporary) magnetization that is induced by the Earth's magnetic field.
The deflection increases when the current is increased because the magnitude of the field is directly proportional to the strength of the electric current. That is, stronger the electric field, stronger the magnetic field.
If you're lost in the woods, your best chance of finding your way might be a tiny magnet. A magnet is what makes a compass point north -- the small magnetic pin in a compass is suspended so that it can spin freely inside its casing and respond to our planet's magnetism.