When the pencil magnet is held by the wire clip, the pencil magnet moves when the magnet at the tip is attracted to magnetic minerals present in a rock.