Any metal with iron in it is ferrous metal and can therefore take on a magnetic charge. The usual way a knife or tool can become charged (become magnetic) is for it to be in contact with another magnet. Setting it on a speaker magnet or being in contact with a magnet while sitting in a tool box for instance are common occurrences
.
The other possible way, which is actually what is happening with the permanent magnet example above, is for the knife to be in a electromagnetic field. Magnets have their own magnetic field. But electricity can form the fields as well and quite frankly are usually the stronger fields of the 2.
So what is the outcome of this gobbledy gook? If the knife is around electric motors, Transformers, Generators, Large medical equipment like XRay, CAT or MRI machines all generate strong and though usually not large magnetic fields. The knife only needs to be brought into the field it can take on an electrical charge. You cannot see or feel the field on your own so it is quite easy to pass through a field without knowing it.
Want to get rid of it? You can either buy a cheapo fixed magnetizer, demagnetizer available from most tool shops, or you can buy an electric one. What you would look for is a demagnetizer or degauser. They have them for a whole host of applications. Demaging the heads on tape machines, bulk erasing of tapes, discs. If you go that route, read and follow the instructions. If you don't do it properly, you will do the opposite of what you want. Last option, you could even just try to have it hold on to a couple of things and often the charge will dissipate on its own.