The idea they are trying to put across is that a surface can be generated by an arc. In the sketch, they are highlighting an arc of the circle and indicating that when the arc revolves around the y-axis, the arc sweeps out an area. Then entire circle would generate the sphere, but the arc only generates the spherical cap.

Until now we have been talking about the entire highlighted circular arc revolving around the y-axis. The entire arc would have to revolve through an angle of 180 degrees to generate the spherical cap. We now want to consider only the right half of that arc and revolve that arc through an angle of 360 degrees, or $2\pi$ radians, to sweep out the entire cap. That will make the math a little simpler.

Now for the math. Each little element ($ds$) of the arc generates part of the surface area. Revolving the arc causes each little element to move along a circular path around the y-axis. These individual paths are not shown, except at the base of the cap. Each of these circular paths has a different radius, $r’$. When the arc revolves by the angle $\theta$, the distance that the element travels is $r’ \theta$. To sweep out the entire spherical cap, we need to revolve the (right half of the highlighted) arc through an angle of $2 \pi$ radians. We just ignore the left half.

The amount of area swept out by $ds$ is $r’ \theta ds = 2\pi r’ ds$. So, to find the surface area, they want find an expression $ds$ and an expression for $r’$. Their expression for $ds$ is $\sqrt{1+\frac{dx}{dy}}dy$, so that why they calculate $dx/dy$. They calculated that first, because they knew would need it later.

The element has coordinates (x,y), where “x” is the distance from the y-axis. In other words, x is the radius $r’$ of circular path that the element takes. That allows them to write an element of area as $2\pi\space x\space ds$. They integrate this expression, the x’s cancel out and $r$ is a constant.