Why do we need importance sampling? Let's say we want to calculate the following expectation:
$$
\mathbb{E}_{z\sim p_z(z)}[f(z)]
$$
One issue, is that the samples from $p_z(z)$ could be not very informative:

We see here that $f(z)$ only takes on non-zero values near the edges of $p_z(z)$.
We we can solve this by using importance sampling, which will take more samples from regions with non-zero contribution.
What I don't understand is why we would want to use importance sampling. I.e., the samples of $z$ that cause $f(z)$ to be zero are going to drag down the expectation towards zero, which seems good since indeed, for most values of $z$, $f(z)$ will be zero.
Note, I'm assuming that the expectation is a single value and roughly, the expression means: "The expected value of $f(z)$ when we randomly sample from $p_z(z)$ is $E$", where $E$ is a single number.

So long as importance sampling is done correctly, it always give an unbiased estimator for the true integral of interest --- this occurs irrespective of the generative distribution you use in the method, so long as it meets the basic requirements.  So the main remaining issue of concern is the variability of the estimator.  As a general rule, the closer the kernel of the generative distribution is to the integrand in the integral (i.e., to the function $x \mapsto f(x) p_X(x)$) the lower the variability of the estimator.  That is largely the point of importance sampling.
