When iron is hit by a hammer, it becomes magnetized. This is because the hammer creates a magnetic field around the iron. The more times the iron is hit, the stronger the magnetic field becomes.