Failed Builds. What is the cause?

I'm building a webplayer game and over the last month or so whenever I do a build around 70% of the time I get the following error: Error building Player: IOException: Failed to Copy File..bla.

Up until now I've just gotten around the problem by hitting build again and again until eventually it just works, but I'd like to know why this is happenening and how I can prevent it..

Why does it fail to copy the file?

I need a little more information, I'm afraid. :P Which file is it? One of the source files? A prefab? A texture? Etc.

Is the file open in some other program, preventing Unity from accessing it? Might there be an orphaned thread that didn't terminate properly during some previous run, that still has the file open?