Peeling and cutting vegetables at the home level is pretty commonly safe. Consumers are removing the exterior where contaminants live and consuming before any potential exterior micro contamination can spread and fester isn't much of a concern.
Peeling and cutting vegetables at the commercial level is pretty nasty. Peeling one onion for your dinner isn't very risky. Peeling and cutting 40,000lbs of onions brings a ton of risks. Everything my company does with cutting fresh fruits and vegetables requires a wash after cutting, as we're breaching the exterior flesh of the produce and introducing contamination to the interior edible bits. To the McD's comment, yes, cutting onions and shipping them afterward is a huge risk that we have to account for (but we weren't the ones who processing those onions for McD's, we just do similar work for retail sale).
To the comparison of broccoli to leafy greens prior: broccoli is a bit more hearty/durable and can be washed with agitation prior to releasing for consumption. But leafy greens are notorious for harboring salmonella or listeria, and the mechanized washing of leafy greens can break and tear the leaves. Simply put, my company does cut fruit and veg trays in 9 facilities, and we as a