A common misconception is that stainless steel is non-magnetic. There are five classes of stainless steel, and only one is non-magnetic.
However, it just happens to be that the most widely used type (austenitic) is the one that is not magnetic.
Magnetism has more to do with the steel’s grain microstructure than with its chemical make-up, so whether or not your stainless will be magnetic will depend on not only its microstructure, but also how it was manufactured or processed. The most common stainless steels, 304 and 316, have an austenitic microstructure and start out life non-magnetic. However as they are manufactured from raw steel to fasteners, they go through several cold forming processes (drawing, roll threading, heading) which changes the microstructure from austenitic to martensitic, thereby making the material more magnetic. The more cold forming, the more its microstructure is changed to martensite, and subsequently the more magnetic the fastener is likely to be.
If magnetism in austenitic stainless is not wanted, steps can be taken to limit it. Manufacturing processes can be chosen that do not cold form, i.e. cut threading vs roll threading. Alternatively, the finished fastener can go through an annealing treatment which will restore the microstructure to its original austenitic state.