Your intuition is right; notice how for the line charge, the sum actually depends on y (that's why the y has subscript i). And that makes sense--look at the problem, as you get farther and farther up the y-axis, the cosine of theta becomes smaller and smaller. So, even though the rod is uniformly charged, charge farther away from the x-axis makes a smaller contribution to the E-field at the point (the smaller contribution is also due to the inverse-square fall off of the E-field). And the problem hints at why you have to substitute (Q/L) dy for dQ: (Q/L) dy is descriptive of how the charge is configured in space, dQ is not.
I actually think their use of (Q/L) is confusing! Usually, we call this quantity lambda--linear charge density. As you get into more advanced physics, you'll encounter charge distributions that are a function of your position! So the value changes based upon your y-position (or, once you get to 3D-space, it will depend on x,y,z--we call that volume charge density and use rho instead of lambda).
For the ring, you're equidistant from all charge on the ring and all charge makes the same contribution to the E-field at the point. That's why the sum is independent of z. But if you're unhappy with that--just redo the derivation and keep everything inside the sum. I'll use integrals instead of sums, but it looks like this:
E= \frac{1}{4\pi \epsilon_{0}} \int \frac{zdQ}{(z^2+R^2)^{3/2}}
which is just
= \frac{1}{4\pi \epsilon_{0}} \int \frac{z(Q/(2 \pi R))}{(z^2+R^2)^{3/2}} dl
= \frac{1}{4\pi \epsilon_{0}} \frac{z(Q/(2 \pi R))}{(z^2+R^2)^{3/2}} \int dl.
So now you might be wondering, what the hell is dl (note that Q/(2 \pi R) dl= dQ). It's the length of a little segment of the ring. Since this isn't too easy to describe in Cartesian coordinates, let's just think about what
\int dl
might be. Well. It's the circumference of the ring! So that integral is just
\int dl = 2\pi R
and the E-field becomesE = \frac{1}{4\pi \epsilon_{0}} \frac{zQ}{(z^2+R^2)^{3/2}}.I also recommend you maybe check out a different physics book (I'd recommend Halliday & Resnick--I think the newer editions aren't as good as the older ones...but you should be able to find the 5th or 6th edition for like $5 on Amazon). The explanations aren't great in your book, and their use of sums seems kind of silly to me. If you're up for a bit of a challenge, they just started reprinting Purcell's book. It's a great book (a lot of people think it's one of the best physics books ever written).