Disclaimer: I'm new to stats so please bear with me
Everywhere I look, the Chi-Square Distribution is explained with a (Z-Score)^2 i.e $$ ((X-\mu )/\sigma )^2 $$ and based on a random variable from a STANDARD NORMAL Distribution in which case it becomes $$X^2$$
However, the Chi Square Goodness of Fit Test is explained with the following formula: $$(Oi-Ei)^2/Ei$$ which can be reinterpreted as $$ (X-\mu )^2/\mu $$
What I'm trying to understand is how can the $\chi^2$ Critical Value for a given P-Value that is derived from $$\sum ((Oi-Ei)^2/Ei) $$
be equal to the $\chi^2$ Critical Value that is derived from a $\chi^2$ distribution based on a random variable that follows a Standard Normal Distribution
$$ \sum ((X-\mu )/\sigma )^2 => \sum ((X-0 )/ 1 )^2 => \sum X^2 $$
The reason I'm asking is because I was watching this video https://youtu.be/ZNXso_riZag?t=620 where the guy just plugs in the P-Value and the degrees of freedom without specifying any sort of $\mu$ which leads to me to believe the Critical Value he got was from a $\chi^2$ distribution whose random variable was based on a STANDARD Normal Distribution and yet the actual normal distribution of his problem is different from a Standard Normal Distribution. So shouldn't he be getting a different $\chi^2$ critical value ?
Basically,
$$\sum ((X-\mu )/\sigma )^2 \neq \sum ((Oi-Ei)^2/Ei) $$