Mysterious magnetic stars may arise when supernovas blast out matter