What gives magnets their magnetic properties?