How does a nail become a magnet?

you have to put it through an electro magnet to make it magnetic