A wave crossing a reef is losing energy the whole way in, starting well before it stands up and throws. You can feel the mechanism when the water down near the bottom surges forward and then pulls back, once for every wave passing overhead. That back and forth is the wave’s orbital motion reaching the seafloor, and it interacts with the makeup of the floor, not just the slope of it.
Looking at the ocean floor, it’s difficult to say exactly how rough the bottom is. There are individual rocks and coral heads, then large and relatively flat features. There are small coral organisms growing, each with their own size and shape.
Instead of trying to measure each feature from the centimeter scale on up, oceanographers roll all of that into one number called the friction factor, which is really just a measure of how much a particular bottom grabs at the water sliding over it. It is a bit like the grit of sandpaper, telling us whether the bottom is generally coarse or fine.

Over a smooth floor only a thin layer right at the bed is really dragging. If you put obstacles in the way, the water has to go around them, peeling off the back of each one and leaving a swirl behind it. Those swirls break down into smaller and smaller ones until the motion ends up as heat. Taller obstacles, spaced so the water has to thread between them, mean more swirls and a thicker band of churned up water above the bed for the wave to drag along with it.
A sandy bottom hardly takes any energy from a wave. The ripples are small and rounded and the water mostly slides over the top of them, which is why models of the surf zone often leave friction out altogether and get an answer close enough to the real deal. A rock bottom does more, since ledges and boulders give the water a bit more to catch on. A healthy coral reef sits so far past both that the bottom can take more out of a wave than breaking does over the whole crossing.
The difference between sand and coral is not only the size of the features, it’s how far up into the water the resistance reaches. Over sand the pushing and pulling happens on ripples a couple of centimeters tall and stays pinned near the bed. Over coral it acts on every branch, plate and lobe on the reef. A single head presents several times more surface to the flow than the patch of seafloor it sits on, and the heads are packed closely enough that water threading between them moves noticeably slower than water passing over the top. The dragging layer now fills the canopy from the substrate to the tips of the coral, all of it working on the wave at once.
How much any of this costs depends steeply on how fast the water at the bed is moving. The energy pulled out goes as the cube of that speed, so water moving twice as fast over the same bottom takes eight times as much out of the wave overhead.
Depth is also an important factor in this. Orbital motion weakens with distance below the surface, so in deep water the roughness barely sees the wave at all, and as the water shallows the same wave drives progressively stronger flow across the reef. Long-period swell carries its motion deeper than short-period wind swell, so it starts paying the friction tax further offshore. A wide, shallow reef in front of the break subtracts from the swell across the entire crossing.
All in all, friction takes energy out of the wave and never gives it back, so the wave arrives at the break smaller than it otherwise would have. It does that continuously across the whole shallow crossing rather than all at once, which is why the width and depth of the rough ground matter as much as how rough it is.
Further Reading:

