Why do outside charges do not contribute to net flux of a Gaussian Surface? I don't quite understand why external charges can be ignored when calculating the net flux of a Gaussian surface. I understand that $\nabla \cdot \vec{E}$ of any point charge equals $0$ and I can reason using equations, but I can't find an intuitive physical understanding. Most arguments I have heard mention that all electric field lines that enter a Gaussian surface must then leave it, and so an external charge has no effect on net flux. But doesn't the flux also depend on the magnitude of the field?
For instance, Let's say I had a particle next to a Gaussian sphere and I look at the electric field line which pierces the sphere at its closest point. Wouldn't the field vector's magnitude be greater when it enters the sphere compared to when it exits because it is farther away when it leaves? And by the equation for flux,

$$\int \vec{E} \cdot \mathrm{d}\vec{A} = \int  E \cos (\theta) \ \mathrm{d}A$$

which depends on $E$, wouldn't this have an affect on the net flux?
I'm not sure where my misunderstanding of flux is, but I know that I am clearly missing something huge. Perhaps is it that I have to consider all electric field lines and not just a single one? Or am I incorrectly assuming something about the relationship between the magnitude of the field and the flux through the surface?
 A: There is a more intuitive view. Each field line of the flux created by an internal charge crosses the surface only once. 
However, any external charge's line will either not pass over the surface or cross it twice.


*

*If the line doesn't meet the surface, iit doesn't contribute. 

*If the line crosses the surface, as there are no sinks inside the surface, the line will have to exit as well. The input and the output cancel out.


Hence, only internal charge contributes to the flux.
A: As @AHB has already said, its just pure mathematical result. Unlike fields flux is not actually per se a physical phenomenon. The $\cos\left(\theta\right)$ is the cosine of angle between the field at that point and the area element $\mathrm{d}A .$ So if its a uniform field, its also true for non-uniform ones considering gaussian surfaces with uniform fields makes the calculations easier, for example a sphere in uniform field from left to right, the $\theta$ will be less than ${90}^{\circ}$ on the right  and the $\theta$ on the left side will be greater than ${90}^{\circ}$ and between ${180}^{\circ} .$ So the flux equation for net flux will become
$$
E \int{\cos\left(\theta\right) \, \mathrm{d}A} - E \int{\cos\left(θ\right) \,  \mathrm{d}A} ~=~ 0$$
since $\cos\left(\theta\right)$ is negative in ${90}^{\circ} \le \theta \le {180}^{\circ} .$
A: If a charge is kept near a sphere, the charge will not affect the flux of the sphere because flux is dependent on magnitude of electric field and area it pass through. So when the field enters the near end of the sphere the magnitude of electric field is high and the surface pass through is low but when the filed comes out the magnitude of electric field is low but the area it pass through is high. Hence, it compensate and don't affect the flux of the sphere.
A: Suppose you enclose a positive charge with a Gaussian surface, then you put another positive charge near it but outside the surface. The field lines might look something like this:

Remember, you choose your Gaussian surface because you want to find the charge inside it. You can pick a surface arbitrarily close to one of the positive charges, and until it becomes big enough to actually enclose the second charge, the field lines passing through the surface will cancel out. Since the magnitude of the electric field due to the charge inside the surface is dependent only on the enclosed charge ($E = \frac{kQ}{r^2}$), there will be no increase in the magnitude of the field exiting the surface by putting more charges outside, and so the flux will remain the same.
A: It's been over three years but here is a reasoning based completely on your question(for someone who came by recently with the same doubt).
When you consider electric field lines, it's important to note that what represents the strength of the electric field is not the length of the electric field lines butt how closely they are packed together.
So, the no. of lines passing through the surface is the measure of flux (not the absolute number as infinite lines can be drawn). Since no matter how many lines you draw, every line entering must leave the surface, the flux has to be zero. 
If the field is constant (like for an infinite sheet of charge), the area through which the field enters will be the same as the area through which the field leaves.
If the field varies with r (point charge, for example), the area through which the field leaves the surface will be more than through which it enters such that the net flux will be zero ( entering = high field * low area and leaving = low field * large area)
A: 
Even though the magnitude of electric field is greater at the charge closest point,the flux is the whole value of EdAcos(theta) which is same everywhere.
A: Several methods can be used to deduce the flux due to an external charge is zero but the approach of prof. H.C. Verma would be easier.
The flux of the electric field due to a charge $q$, through a small area $\mathrm{d}S$ is
$$\mathrm{d}\phi=k\frac{q\,.\mathrm{d}S}{r^2}=k\frac{q\,\mathrm{d}S \cos\alpha}{r^2}=k\frac{q\,\mathrm{d}\Omega}{r^2}$$ where a is the angle between the normal surface vector and electric field and $dΩ$ is the infinitesimally small solid angle subtended on the external point.
If we do the area integral over the total closed surface we get the total solid angle subtended on the external point is zero. Hence $\phi=0$.
(I refer to this site for the explanation of why solid angle becomes zero.)
