Why is the risk equal to the empirical risk when taking the expectation over the samples? From Understanding Machine Learning: From theory to algorithms:

Let $S$ be a set of $m$ samples from a set $Z$ and $w^*$ be an arbitrary vector.  Then $\Bbb E_{S \text{ ~ } D^m}[L_S(w^*)] = L_D(w^*)$.
Where: $L_S(w^*) \equiv \frac{1}{m}\sum_{i=1}^ml(w^*, z_i)$ and $z_i \in S$, $L_D(w^*) \equiv \Bbb E_{z \text{ ~ }D}[l(w^*, z)]$, $D$ is a distribution on $Z$, and $l(\text{_},\text{_} )$ is a loss function.

I see that $$\Bbb E_S[L_S(w^*)] = \Bbb E_S[\frac{1}{m}\sum_{i=1}^ml(w^*, z_i)] = \frac{1}{m}\sum_{i=1}^m \Bbb E_S[l(w^*, z_i)]$$ and
$$L_D(w^*) = \Bbb E_z[l(w^*, z)] = \sum_{z \in Z} l(w^*, z)D(z)$$
But how are these two equal?  $\Bbb E_S$ is an expectation  over samples $S$ of size $m$ whereas $\Bbb E_z$ is an expectation over all samples in $Z$.
 A: The result is true if the sample $S$ of size $m$ is iid. In this case $S=(z_1,\dots,z_m)$ has indeed distribution $D^m$, because $D_S(z_1,\dots,z_m)=\prod_{i=1}^m D(z_i)$. Thus:
$$\mathbb E_{S \text{ ~ } D^m}[L_S(w^*)] = \frac{1}{m}\sum_{i=1}^m \mathbb E_{S \text{ ~ } D^m}[l(w^*, z_i)]$$
Consider now $i=1$: $\mathbb E_{S \text{ ~ } D^m}[l(w^*, z_1)]=\int l(w^*, z_1)D(z_1,\dots,z_m)dz_1\dots dz_m$ according to LOTUS. But, because of the iid hypothesis, this is actually equal to
$$\int l(w^*, z_1)D(z_1,\dots,z_m)dz_1\dots dz_m=\int l(w^*, z_1)\prod_{i=1}^m D(z_i)dz_1\dots dz_m=\prod_{i=2}^m\int D(z_i)dz_i \int l(w^*, z_1)D(z_1)dz_1 = \mathbb E_{z \text{ ~ }D}[l(w^*, z)]=L_D(w^*)$$
Of course, you can apply exactly the same argument for any $i=2,\dots,m$. This implies that 
$$\mathbb E_{S \text{ ~ } D^m}[L_S(w^*)] = \frac{1}{m}\sum_{i=1}^m \mathbb E_{S \text{ ~ } D^m}[l(w^*, z_i)]=\frac{1}{m}\sum_{i=1}^mL_D(w^*)=L_D(w^*)$$
A word of caution: you better be a bit flexible when it comes to notation, in reading Shai Ben-David and Shai Shalev-Shwartz. They can be a bit of a sticklers for notation: if you insist on following their pedantic notation too strictly, studying their book will take (even) more time than it should take. And you still need to read Mohri et al. book afterwards, so....
A: If we assume that the points in $S$ are i.i.d., then this is a direct consequence of the fact that the sample mean is an unbiased estimator of the population mean: For $X_1, \dots, X_m$ i.i.d. with $\mathbb{E}(X_i) = \mu$,
$$
\mathbb{E}\left( \bar{X}_m \right) = \mu.
$$
To obtain the result in your question, simply identify $L_S(w^*)$ with $\bar{X}_m$ and $L_D(w^*)$ with $\mu$.
This is a common issue for people getting started in machine learning — the heavy notation makes simple facts difficult to recognize. I sometimes find it useful to make a mental translation like the one above, where I discard all the subscripts and notational excesses that aren't immediately relevant to the claim in question.
