why only some pieces of iron behave as iron
Well, only some pieces of iron have like because they are 'magnetically charged'. A piece of iron has magnetic tendencies but until and unless it is magnetized in the presence of external magnetic field it will not become a magnet. A magnetic material has all its atomic dipoles (little magnets) aligned in the same direction as the magnetic field. A regular piece of iron however has its dipoles randomly oriented and thus it has no net magnetization.