Generating speed in surfing is the only way to make sure you'll be pulling the highest airs, most powerful carves, and snaps. Trimming is a technique which changes with differing speeds, so mastering the art of speed will allow you to explore a wave to the fullest.
Speed lines are imaginary routes drawn on the face of the wave. They're always changing as the roller peels across the line-up, and surfers have to adapt to its constant mutation.
Interestingly, optimal surf lines can be horizontal or vertical depending on the type of the wave you're riding, and on what you're about to do next.
Waves peeling like a freight train will force you to pump down the line; mushy waves will ask you to find speed by bouncing through bottom turns and top-to-bottom approaches.
Steep wave faces invite you to drop almost laterally. When you reach the bottom, use your knees and ankles to get a quick early pump. With your back foot a little more forward, start a press-and-release feet game for maximum speed and let the pump work on the rail-to-rail movement.
Keeping a low stance will help you gain speed across the line. Remember that speed is gained in the pocket zone, i.e., in the area closest to the crest (top third of the wave). You'll rapidly feel the flow, and your surfboard will speed up.
If you're actually too fast, you'll end up in the shoulder of the wave. You don't want that, so make sure you make a few turns while trimming the line to keep in the workable section of the ride.
The most common mistakes surfers make when generating speed are: spending too much time in the flats, surfing above the pocket, digging rails, and applying too much pressure on the back foot (stalling).