Chi square distribution with $n$ degrees of freedom is the sum of $n$ independent normal distributions.
If $X_i \sim N(0,1) \ ;i=1,\ldots,n$ then $\sum_{i=1}^n{X_i}^2 \sim \chi_n^2$.
It is mainly used for Testing of Hypothesis and regression statistics.
What you are seeing is another way of writing Chi-square. It was introduced to us in a similar manner in probability.
Consider $X_i \sim N(0,\sigma^2 )$. Then $\frac {X_i^2}{\sigma^2} \sim \Gamma (\frac 12,\frac 12)$. Adding we get, $\sum_{i=1}^n \frac {X_i^2}{\sigma^2} \sim \Gamma (\frac n2,\frac 12)$ whic is precisely Chi square distribution.
For more general result,please check Proof of $\frac{(n-1)S^2}{\sigma^2} \backsim \chi^2_{n-1}$
I don't know how the formula originated, but can give you one of major (probably) reasons behind use of this formula. Suppose you want to find $E(s^2)$, then you can use this formula. This leads to chi square test.
Also I think that it is worth mentioning that chi squared is the distribution of Quadratic forms for standard normal.