I'm currently studying Classical Electrodynamics, and I see everywhere that the flux of a field through a surface is defined as the normal component of the field times the surface area. They interpret this in a physical way as the net charge flowing through the surface in the unit of time. My question is what is the net charge? Is it charge going out - charge coming in?
Assuming you're reading a real textbook, you're probably either misreading or misinterpreting it. The electric field (for example) and its flux do not represent a flow of electric charge.
That's true, but the physical sense of the surface integral over or the divergence of a vector field is indeed the flux through a surface. Let's look at a fluid with density [itex]\rho(t,\vec{x})[/itex], which gives you at an instant of time, [itex]t,[/itex], the number of particles per unit volume at position [itex]\vec{x}[/itex]. Further, the fluid is characterized by a velocity field, [itex]\vec{v}(t,\vec{x})[/itex]. Now take a fixed volume, [itex]V[/itex], in space with the surface, [itex]\partial V[/itex]. Along the surface we define the normal vectors [itex]\mathrm{d} \vec{F}(\vec{x})[/itex] such that this normal is always pointing out of the volume. The length of this vector is that of the infinitesimal surface element around [itex]\vec{x}[/itex]. Now, the question is, how many particles of the fluid per unit time flow through the surface of the volume. To answer that question we think about an infinitesimal layer of fluid inside the volume along the boundary which flowing out within the infinitesimal time, [itex]\mathrm{d} t[/itex]. The volume element of this fluid around [itex]\vec{x}[/itex] on the surface obviously is given by [itex]\mathrm{d} V= \mathrm{d} t \vec{v}(t,\vec{x}) \cdot \mathrm{d} \vec{F}(\vec{x}).[/itex]. Since the density (particles per volume) of the fluid at this place is [itex]\rho(t,\vec{x})[/itex], the total number of particles flowing out of the surface is given by [tex]N_{\text{flux}}=\int_{\partial V} \mathrm{d} \vec{F}(\vec{x}) \cdot \vec{v}(t,\vec{x}) \rho(t,\vec{x}).[/tex] Locally thus the flow through the surface is characterized by the current density, [tex]\vec{j}(t,\vec{x})=\rho(t,\vec{x}) \vec{v}(t,\vec{x}).[/tex] Of course, the infinitesimal scalar product [itex]\mathrm{d} \vec{F} \cdot \vec{j}[/itex] can be as well negative as positive, which means not more than that the velocity of the volume element under consideration is directed inwards. Thus, inward flow is counted negative, and outward flow positive. If we make the volume element very small and locate around a positive [itex]\vec{x}[/itex], we can get the local form of the total flux with help of Gauss's theorem, [tex]N_{\text{flux}}=\int_{\partial V} \mathrm{d} \vec{F} \cdot \vec{j} = \int_{V} \mathrm{d} ^3 \vec{x} \vec{\nabla} \cdot \vec{j}.[/tex] To get the local form, just make the volume smaller and smaller and divide by this volume. If the volume becomes smaller than the typical length scale at which [itex]\vec{\nabla} \cdot \vec{j}[/itex] changes considerably, you can take this quantity out of the integral, and dividing out the volume gives [tex]\frac{\mathrm{d} N_{\text{flux}}}{\mathrm{d} V}=\vec{\nabla} \cdot \vec{j}.[/tex] Also very often one needs to formulate a conservation law in local form. For our fluid example one very often has the situation that the total particle number is conserved (as long as there's no chemical reaction of any kind). Then the change of the total number of particles inside the volume per unit time, i.e., [tex]\frac{\mathrm{d} N_V}{\mathrm{d} t}=\int_{V} \mathrm{d}^2 \vec{x} \partial_t \rho(t,\vec{x})[/tex] must be given by the number of particles flowing through the surface. Since we count particles moving inward negative, we have to set this equal to the total negative flux: [tex]\frac{\mathrm{d} N_V}{\mathrm{d} t}=-N_{\text{flux}}=-\int_{\partial V} \mathrm{d} \vec{F} \cdot \vec{j}=-\int_V \mathrm{d}^3 \vec{x} \vec{\nabla} \cdot \vec{j}.[/tex] Using an infinitesimal volume, we get in the same way as above the local conservation law in form of the continuity equation, [tex]\partial_t \rho(t,\vec{x})=-\vec{\nabla} \cdot \vec{j}(t,\vec{x}).[/tex] Of course, this is only the most intuitive example for the use of vector calculus to fluxes. In electrodynamics this physical situation is applied not to the number of particles but to the electric-charge density and electric current density, which fulfill the continuity equation, because electric charge is a conserved quantity. But it also appears in more abstract form, where there is no direct interpretation in the sense of flux. Then such laws may describe the sources of fields. E.g., Gauss's Law states that the surface integral over the electric field gives the total charge contained inside the volume (in Heaviside-Lorentz units; if you use the SI there appears a factor [itex]1/\epsilon_0[/itex] or if you use Gauss units a factor [itex]4 \pi[/itex]): [tex]Q_V=\int_{\partial V} \mathrm{d} \vec{F} \cdot \vec{E},[/tex] which reads in local form [tex]\rho=\vec{\nabla} \cdot \vec{E},[/tex] which is one of the basic laws of electrodynamics (i.e., one of the Maxwell equations). For a magnetic field, there's also such a law. Since up to now nobody has found evidence for magnetic charges, one assumes there is none in nature (also this would have the profound consequence of charge quantization in quantum electrodynamics, which cannot be derived from first principles but must be assumed as an independent principle), i.e., the analogue of Gauss's Law for the magnetic field reads [tex]\int_V \mathrm{d}^3 \vec{x} \vec{\nabla} \cdot \vec{B}=0 \quad \text{or}\quad \vec{\nabla} \cdot \vec{B}=0.[/tex]