I always interpreted the formula as consisting of two parts.
Given a kernel $K$ (in your case Gaussian but others are possible) you can define a rescaled version, say $\dot{K}$, as
\begin{align}
\dot{K}(x) = \frac{1}{h}K\left(\frac{x}{h}\right).
\end{align}
As you see changing $h$ therefore effectively changes the width of the kernel (and $\dot{K}$ is still a proper density function).
If your kernel $K$ has a finite support, say $[-1,1]$, changing $h$ will change which points get zero weight (as you change the support of $\dot{K}$) and which points get a positive weight.
As the Gaussian kernel is supported on $\mathbb{R}$ there is no hard cut-off in this case (so the effect is maybe less clear).
The second part of the formula is a simple average.
With $\dot{K}$ we can rewrite $\hat{f}_h(x)$ as
\begin{align}
\hat{f}_h(x) &= \frac{1}{n} \sum_{i=1}^n \dot{K}(x - X_i)\\
&= \frac{1}{n} \sum_{i=1}^n \frac{1}{h}K\left(\frac{x - X_i}{h}\right)\\
&= \frac{1}{nh} \sum_{i=1}^n K\left(\frac{x - X_i}{h}\right).
\end{align}
As you see the $(nh)^{-1}$ part is partly due to averaging $\dot{K}$ at the points $x-X_i$, and partly due to the bandwidth $h$ which will determine the weight that points far away from $x$ receive.