First, it must be emphasised that staining is a rare phenomenon and that most cases it is due to something that becomes firmly deposited on the steel, rather than to any attack of the steel itself.
Probably the most common cause of staining is attack by one of the proprietary dip solutions used for removing tarnish from silver.
Although excellent for cleaning silver and E.P.N.S., these solutions should never be allowed to come into contact with stainless steel; they contain acids that etch the steel, first giving it an iridescent rainbow stain and ultimately etching it a dull grey. Even if care is taken to dip only the sliver handle of a knife, it is so easy, when lifting it from the solution, to let drips fall onto the stainless steel blades that happen to be lying around.
All tap water contains dissolved mineral salts that would leave an extremely thin film on any article on which it was allowed to dry out without wiping. In most cases, the resultant stain will wipe off, but occasionally more vigorous treatment is needed, using a polishing preparation, such as Solvol's 'Autosol' (available from many motor car accessory shops and some other retail outlets).
Detergents, especially unnecessarily strong solutions of detergent, can leave an indelible rainbow stain on stainless steel if they are not rinsed off and are allowed to dry out on its surface.
Very hard water can deposit a chalky film on stainless steel, but this is only likely to occur in dishwashers that use un-softened or incompletely softened water.
Very hot grease, fat or meat juices sometimes leave stubborn rainbow coloured stains on stainless steel, but this is more likely to occur on meat dishes than cutlery - again this does not mean there is anything wrong with the stainless steel and the articles will be as good as new after the stain has been removed.
Heat by itself will impart a rainbow coloured heat tint to stainless steel, but this is only likely to occur if the cutlery is accidentally left on a hot plate or gas burner, when the cause would be immediately obvious.
Prolonged immersion in synthetic 'vinegar' (condiment) can stain stainless steel knives if left on form several hours, but more rapidly if the 'vinegar' also contains salt.
Sometimes rust coloured stains occur. Wet fragments of steel wool that find their way onto the knives may go rusty and leave indelible rust stains on the stainless steel. Other rust coloured stains may come from corrosion pits in the knives, although the pits themselves may be so small as to be barely visible.
Most stains that resist ordinary rubbing with a soapy cloth can be removed with 'Autosol' which is readily available in high street stores.
Finally, it must be pointed out that there may be other causes of staining that have not yet been identified.