How can steel shavings get magnetized while hole tapping?

I'm not sure what kind of steel you are using, but with stainless steel, many varieties are slightly magnetic. As I recall, when we were building a spectrometer that was very sensitive to magnetic fields, we were careful to use only "austentic stainless steel", which is not magnetic. I think that we paid extra for this feature.

So, I agree with the comment from @lionelbrits, the steel could have already been lightly magnetized but you could only observe it when you cut a very small piece.