While applying Gauss' Law, the electric field at a point on the Gaussian surface has to come from superposition of electric fields of all the charges, whether outside or inside the Gaussian surface. However, the charge $Q$ has to be only from inside the surface. The law somehow implies that the flux due to a charge is only dependent on the charge inside ($\frac{Q_{in}}{\epsilon_0}$) but the other side of equation has a term ($E$) which depends on outside charges as well.
This is a very common cliché for books and sources to mention as a fact that the electric field is due to all charges but $Q$ is only charge inside. But none of them, so far, as I have read, seem to tell why. Why is it so? Isn't it trivial because in a sense we're getting the same flux whether the external charge exists or not?