In addition to the great answer given above, I would like to add an additional perspective by recognizing that my confusion (as per the question) boils down to what is explained in the Derman-Kani paper, which is a "predecessor paper" to the "Local Volatility" paper by Dupire.
In their paper titled "The Volatility Smile and Its Implied Tree" from 1994, Derman and Kani explain how a unique Binomial tree (with time-varying volatilities and implied probabilities) can be extracted from option prices with a smile.
For our simple case here, we just consider two options from the paper and we demonstrate that one unique tree with varying volatility can generate the same two option prices as two different trees with a constant volatility.
We note that in our simple case, the initial price of the underlying is $S_0=100$. The two options we consider are:
- ATM call, $K=100$, 2-year expiry, $IV = \sigma_{BS}=10\%$
- OTM call, $K=110.52$, 2-year expiry, $IV = \sigma_{BS}=9.47\%$
Rates are 3% per year.
In the B-S world, the two IVs give rise to two different Binomial trees with constant volatilities (the trees are constructed as $S_{t+1}^{up}=S_{t}e^{\sigma_{bs}}$, $S_{t+1}^{down}=S_{t}e^{-\sigma_{bs}}$):
Pricing the two options:
$$C(t=2,K=100,r=0.03,S_0=100,\sigma_{BS}=0.1)=\\=\frac{(122.14-100)*0.625^2}{1.03^2}\approx8.15$$
$$C(t=2,K=110.52,r=0.03,S_0=100,\sigma_{BS}=0.0947)=\\=\frac{(120.85-110.52)*0.635^2}{1.03^2}\approx3.92$$
Now, interestingly, Derman & Kani show that a single unique Binomial tree with a varying volatility can be derived from the value of these two option prices (together with imposing a condition that the tree has to recombine).
I skip the derivation of the tree and just show it below:
Again, pricing the two options:
$$C(t=2,K=100,r=0.03,S_0=100,\sigma_{BS}=0.1)=\\=\frac{(120.27-100)*0.625*0.682}{1.03^2}\approx8.14$$
$$C(t=2,K=110.52,r=0.03,S_0=100,\sigma_{BS}=0.0947)=\\=\frac{(120.27-110.52)*0.625*0.682}{1.03^2}\approx3.92$$
So the above construct illustrates that a single unique tree with varying volatility and probabilities can price options with a smile, as opposed to essentially having to use two different trees (processes) corresponding to the two implied vols in the B-S world.
Intuition: Focusing on the unique tree with varying volatility and probabilities, we see that the "implied" volatility in the upper branch between $t_1$ and $t_2$ is $e^{\sigma(t_1,t_2)}=ln\left(\frac{120.27}{110.52}\right)\approx8.45\%$; we can therefore see that the unique implied tree starts off with a volatility of $10\%$ between $t_0$ and $t_1$ but then reduces the volatility in the upper branch to $8.45\%$, whilst "increasing" the implied probability of the up-move from 0.625 to 0.682: in other words, by varying these two parameters (volatility and implied probability), the tree can solve for these two "unknowns" to satisfy the two equations for the two option prices (together with the "anchoring" condition that the tree recombines).
Extrapolating this logic to the local volatility model, which reads:
$$S_t=S_0+\int_{h=t_0}^{h=t}\mu_hS_hdh+\int_{h=t_0}^{h=t}\sigma(S_h,h)S_hdW_h$$
one can intuitively guess that by varying the local volatility function across time and the underlying price, one should be able to recover option prices which correspond to the different constant BS volatilities (i.e. in the tree case, the "local-vol" tree has the feature that the average varying volatility between $t_0$ and $t_2$ is roughly equal the average of the B-S volatilities across strikes for options expiring at $t_2$. So for the continuous case, given a fixed point in time, at an intuitive level, we should have that the average of BS volatilities across all strikes for that given maturity is roughly equal to the time-average of the integral of the local vol function up to that maturity).
As far as the local vol function being a function of strike vs. a function of the underlying, it is now easier to see that the strike appearing the the local vol formula is just a parameter that allows one to extract the required local vol value from the given option prices: once the local vol values had been extracted for all possible values of $K$ across all maturities, it is then just a question of changing the argument of the local vol function from $\sigma(K,t)$ to $\sigma(S_t,t)$ so that the local vol function can be used in the SDE for the evolution of the underlying.