If a closed surface does not have any charge inside where an electric field line can terminate, then the electric field line entering the surface at one point must necessarily exit at some other point of the surface. Therefore, if a closed surface does not have any charges inside the enclosed volume, then the electric flux through the surface is zero. What happens to the electric flux if there are some charges inside the enclosed volume? Gauss's law gives a quantitative answer to this question.