To understand the complex Compound Action Potential, we must first start with the basic building block: the single nerve fiber.
First, let's look at how one isolated nerve fiber (an axon) behaves.
If you stimulate a single axon with a small amount of electricity, nothing happens. If you increase the voltage, you eventually reach a specific level, called threshold. The moment you hit threshold, the axon fires a full, complete electrical spike.
This is the All-or-None Law:
Crucially, if you stimulate the axon with double the threshold voltage, the spike does not get bigger. It is always the same size. This single spike is visualized below.

Visualizing the Single Axon: Image 1 shows a single glowing axon. The recording electrodes (right) show the classic 'spike' (Action Potential). This spike always looks the same, regardless of how strong the stimulus is (as long as it's above threshold).
The whole nerve, however, is not like a single axon. A peripheral nerve (like your sciatic nerve) is a massive bundle containing thousands of individual axons, similar to a huge telecommunications cable.
Within this bundle, there is diversity:
This diversity means that every fiber has a different electrical threshold and a different speed. When you stimulate the entire nerve, you are stimulating thousands of diverse fibers at once.
The signal you record from the outside of the nerve is the Compound Action Potential (CAP). The CAP is simply the algebraic summation (adding up) of all the individual 'all-or-none' spikes from the active fibers. It is a "compound" signal because it's made of many smaller signals.

Visualizing the Nerve Bundle: Image 2 shows a cross-section of the whole nerve (a glowing bundle). You can see different sizes of circles representing diverse axons. The electrodes are now on the outside of the whole bundle. The resulting CAP waveform is not a single simple spike; it is a complex, summed shape.