The basic magnetic properties of materials can be very useful when it comes to sorting metals but they are not as simple as it may appear.
It is important to understand that stainless steels can be magnetic or non-magnetic depending on the chemical composition and grain structure of the alloy. This means that some grades of stainless steel are almost non-magnetic, while others are a little more magnetic than they might otherwise be.
The types of stainless steel that are magnetic are the ones with a martensitic or ferritic crystal structure. These are the types of steels that can be used for magnetic purposes and will also tend to have a higher coercive force, making them harder to demagnetize.
Austenitic 304 grade stainless steel is mostly non-magnetic, but it can become slightly magnetic in some areas after cold working (e.g. bending, drilling).
Some austenitic stainless steels can become partially magnetic, forming ferrite in some areas after thermal and work hardening processes. These include 430 and 409L and are known as Ferritic stainless steels.
Martensitic 316 grade stainless steel is generally non-magnetic but it can become a bit weakly magnetic in some areas after cold working. These are used for sanitary cutlery and surgical equipment where a high degree of toughness is required.
Another type of stainless steel is the 304 grade that has a single austenite structure after annealing, with no magnetic properties. This type of stainless steel is commonly used in food processing machinery where small scraps can get caught in the flow of product.