Good players attacks do not fail. They check variations, and make sure that what they are about to do WILL work. That's what makes them good players! They don't just go hit-and-miss.
Planning ahead?

I think a lot of it is misdirection and subterfuge. They try not to reveal their intentions until there is a good chance of success. They also roll with the punches. They set a goal and work toward it. Their opponent may block it or hinder it but they will try other avenues to reach that goal. I don't remember exact games but I recall reading how grandmasters have used ten moves or more in the middlegame to accomplish a single simple goal. Sometimes something as simple as pushing a pawn one square will be fought over by most of the pieces on the board. The reason is that pushing that pawn one square gives the pawn-pusher a decidedly better position. It's a lot like the thrust-cut-parry of a rapier duel. There is move and counter move until one side creates more threats than the other side can parry without loss of some advantage.
I have been getting immersed in the incredible game of chess now for a couple of months and more and am loving it. I consider myself to be an fairly average player. I have played a couple of storming games during which I appeared hardly to put a foot wrong, conversely I have played some absolutely horrendous matches in which my six year old would probably have beaten me. Playing after a night out on the razz or when so tired I am having trouble staying awake letting alone concentrate, I have discovered does not help! ;-)
I have moved away from live chess and into online chess as I think this is more representitive of playing OTB? I gives me time to think and plan my attack/defence BUT it has highlighted the one thing I have always wondered about how the top players get around when they play. You are planning an attack 3 4 maybe 5 moves ahead. The opponent rarely moves in ways that allow you to continue this attack, more often than not they spot it, block you and you end up not only with a failed attack but on the run. A bit of a general wishy-washy question really but how do good players get around this??
Are they just advancing their pieces up the board knowing full well that the actual attack will fail but they will be further up the board?
Are they carrying out 2 or 3 'attacks' at once, i.e. the first two will fail but plan C will probably not?