Why does "$|E|^2 \propto $ the number of photons" follow from "$\epsilon_{photon} = hf$"? For my introduction to quantum physics course we are using the book "University Physics volume 3", availabe here, in the linked chapter in the first paragraph of the "Using the wave function" heading, the following is stated

The energy of an individual photon depends only on the frequency of light, $\epsilon_{photon} = hf$, so $|E|^2$  is proportional to the number of photons

$|E|$ here refers to the energy density of a light wave at a specific point in space and time.
I cannot find any context which explains why the second statement follows from the first and it appears that we are just expected to take this at face value. I am not satisfied just accepting that this there supposedly exists some reasoning that takes us from

The energy of an individual photon depends only on the frequency of light, $\epsilon_{photon} = hf$

to

$|E|^2$  is proportional to the number of photons

since I believe my understanding of this second statement will be greatly improved if I can understand how it follows from the primer.
So that is what I am asking how and through what reasoning does the fact that "The energy of an individual photon depends only on the frequency of light, $\epsilon_{photon} = hf$" lead to the conclusion that "$|E|^2$  is proportional to the number of photons"?
 A: $|E|^2$ here actually means "square of the electric field", not "square of the energy density."
In vacuum, it turns out that the energy density of the electromagnetic field is proportional to $|E|^2$.$^\star$ Since the energy density of the field should be the number of photons in the field$^\dagger$ times the energy of one photon, we have $|E|^2$ is proportional to $\epsilon$.

$^\star$ Footnote for the pedantic: In general the energy density is proportional to $|E|^2+|B|^2$, but for plane waves in vacuum and in units where $c=1$, $|E|=|B|$, so we can say in vacuum the energy density is proportional to $|E|^2$.
$^\dagger$ Footnote the super pedantic: yes, I know the number of photons in the field may not be a well-defined concept in general.
A: In the first sentence you quote, the "only" is more important than the actual equation for photon energy. For photons of a given frequency, the energy flux through a given area is therefore proportional to the photon flux.
From classical electromagnetism, the energy flux in vacuo is proportional to $\overline {E^2}$. Hence the textbook's claim.
