I've had discussions with other home brewers who claim that a bi-product (which I've admittedly since forgotten what exactly it was) of fermentation conflicts with the hops to cause skunking of beer. I've always thought that skunking happens immediately after the beer goes into the carboy, but then it occurred to me that so many brewers are doing their hop additions outside on a burner in broad daylight. Where is the line drawn? Does ultraviolet rays cause skunking from the minute they're added to the boil kettle? Does the beer have to ferment (or begin fermenting) in order for the beer to become skunked? What is the scientific reason behind beer getting skunked?
According to this HomeBrewTalk wiki article on MBT and this Khymos article on "lightstruck flavor", skunking occurs when isohumulone reacts with riboflavin and ultraviolet light to create MBT. The HBT wiki article suggests riboflavin is present in wort, but it is also created by yeast; the amounts in wort and beer are unknown to me.
I'd guess that fermentation creates more riboflavin, leading to skunking occurring primarily after primary fermentation, but I don't have a source to cite for that.