Detonation typically occurs near TDC...preignition is when the combustion process begins well before TDC...resulting in the engine having to compress the hot gasses to the clearance volume after all of the combustion energy has been released...resulting in much higher temperatures and pressures than would normally be subjected to the components of the combustion chamber, but that also means that the components are exposed to these increasingly hostile conditions for a longer period of time (most of the compression and power stroke). Because detonation typically occurs near TDC...and because detonation is a completely different phenomena, the high pressures and temperatures generated are at their worst only during the period near TDC and the powerstroke.
The difference b/w detonation and preignition is that preignition is usually still a single ignition source, controlled combustion process, releasing energy relatively slowly compared to detonation. Detonation, by definition, is an irregular combustion in which the normal ignition source and/or multiple autoignition points ignite the compressed air-fuel mixture, resulting in multiple flame fronts converting the air-fuel mix into a mixture of combustion byproducts and heat. Because there are more than one flame front, the release of byproducts and energy happen much more quickly, resulting in a pressure spike occurring faster than the engine was designed for.
In contrast...normal combustion is timed such that the bulk of combustion begins aTDC and continues to progress in a relatively slow, controlled manner as the piston begins to move into the power stroke, that way you actually use all of the energy released. The spark ignition source can be timed bTDC, but only to account for ignition lag, the bulk of the energy release comes aTDC. In comparison, detonation can occur very very quickly in an uncontrolled manner, such that the bulk of the energy released is done so bTDC, at TDC, or very slightly afterwards, which is not what the combustion chamber is designed for. This sudden violent release of combustion energy imparts much higher stress on related components, even though the total amount of energy released is more or less the same as normal combustion.
While preignition and detonation (in the scope of automotive applications) are semi related due to the fact that they are both undesirable and uncontrollable combustion processes, as well as some of their potential causes, they are completely different beasts in terms of where they happen, what damage they cause, and how they cause said damage. I do admit that detonation can eventually become the cause of preignition. And to dicer, yes the boundary layer in terms combustion chambers refers to the protective layer of low-velocity gas that surrounds the inner surfaces of the combustion chamber.
I hope this helps,
LostHippie