In a wave, the particles of the medium are all oscillating. The particles pass on the oscillations from one to another, hence the oscillations lag more and more behind, the further the particles are from the source – but that doesn't matter; all that matters is that the particles are oscillating.
The simplest type of oscillation is sinusoidal, or 'simple harmonic'. That means that the particle's displacement at time t is$$x=A \sin(2\pi ft+\phi).$$ Here, A is a constant, the amplitude, f is the frequency, and $\phi$ is the phase constant (which is increasingly negative the further the particle is from the source). For our purposes we lose nothing by putting $\phi=0.$
The particle's velocity is given by$$v=\frac{dx}{dt}=A2\pi f \cos 2\pi ft$$ so its kinetic energy is$$E_k=\frac{1}{2}mv^2=2 \pi^2 mA^2f^2 \cos^2 2\pi ft.$$$$E_k=\tfrac{1}{2}mv^2=2 \pi^2 mA^2f^2 \cos^2 2\pi ft.$$
The mean kinetic energy of the particle over a complete cycle is $\pi^2 mA^2f^2$. We can show that the particle has an equal mean amount of potential energy, so the particle energy is proportional to $A^2$ and $f^2$ ! And that applies to each particle in the path of the wave.