There are two different methods of computing a random ray bounce being compared in this section of the online book, the first one is: Pick a point $s$ anywhere inside the sphere, then compute a vector from a point $p$ on the surface to the point $s$ inside the sphere.
The second method is: Pick a point $s$ anywhere on the surface of the sphere, then compute a vector from the point $p$ to the point $s$ on the surface of the sphere.
After computing the random vector, compute the angle $\phi$ between the given normal vector and random vector. That angle is then used in the lighting computations.
Given the two methods of computing a random vector the question arises: "Are these two methods equivalent and how do we show that they are or are not?" To show that we have to somehow compute every possible angle using the two different methods which should result in a function they are equivalent to. The bit of language "every possible angle" suggests using integrals over a volume for the first method and integrals over a surface for the second method. And that is where these two approaches diverge, the integration over the volume gives a different answer then the integration over the surface.
...skipping all the math...
The first method it turns out, after doing a bunch of calculus, is equivalent to $cos^3(\phi)$ suggesting that all those points on the interior of the sphere are skewing the random vector angle towards the center of the sphere which are close to the normal vector.
The second method, after a bit more calculus, gives the result $cos(\phi)$ which is the answer we were hoping for.