Since no one seems to want to read the PDF I linked to above describing the chemistry, I’ll attempt to paraphrase.
1. What makes stainless steel rust-resistant is the chromium in the mixture. When exposed to air, it forms a chromium oxide layer that is resistant to rust. If a process reduces the amount of CrO in any area, or covers it, then rust can form.
2. If the chromium is not uniformly distributed in the steel matrix, there can be small areas where there is little chromium, and less capability to form CrO. In this case, it is a deficiency in the alloying process. This may or may not be the case in these examples.
3. Another common cause of rusting is When a piece of high-carbon steel or iron is rubbed against stainless and leaves a scratch and some of the high carbon material behind. That will then rust. Consider leaning over an iron railing on a balcony and the bracelet makes enough contact to leave a scratch. You’ve probably transferred non-stainless material as well, which will rust. In this case, the stainless material underneath will form CrO and not rust, only the surface material will rust.