what is magnet and its properties