Imagine a light bulb. You want to collect all the light coming from it so you wrap it in solar panels. It doesn't matter how far the solar panels are away from the light bulb or how large the spherical shell of solar panels is, as long as it's fully enclosing the light bulb all the light will be collected.
Same idea. You are adding up all the electric flux coming from a source. So it doesn't matter how far away you are from the source, as long as you fully enclose it in an imaginary shell you will capture all the flux. Just like light intensity, the flux density will decrease as you get farther away because it spreads out but when you are farther away the surface enclosing the source is also a much larger area too and you still end up collecting the same amount of light/flux except now you are collecting it over a larger area witih lower density rather than a smaller area with higher density. So density might change, but the total does not.