With any "paint" be it rattle can or spray gun, the prep work will mean the difference on wether it stays on or just flakes off.
That being said, a rattle can has very little hardeners in the paint, with a spray gun that you mix the paint ( be it 1 or 2 stage ), you can determine the hardness you want depending on the type/style of paint you use.
The cost is more expensive for a spray type paint style, but in this case "you get what you pay for" in the paint application and durability.
But to reference what I said first, without the proper prep, the end result will be the same no matter what style you use.