How does magnetism provide information about the composition of rocks?