Why does this trick gives precisely the formulas for the sum of the $n$ first naturals and the $n$ first squares? I've learned a cool trick several days ago. Suppose I want to find a polynomial that gives me: 
$$f(1)=1, \quad f(2)=5,\quad  f(3)=14,\quad f(4)=30\tag{1}$$
I could do the following: Take a polynomial of degree $3$ and make the following system with it:
\begin{eqnarray*}
  {ax^3+bx^2+cx+d}&=&{1} \\ 
  {ax^3+bx^2+cx+d}&=&{5} \\ 
  {ax^3+bx^2+cx+d}&=&{14} \\ 
  {ax^3+bx^2+cx+d}&=&{30} 
\end{eqnarray*}
I just need to substitute the $x^n$'s according to $(1)$. This gives me:
\begin{eqnarray*}
  {a1^3+b1^2+c1+d}&=&{1} \\ 
  {a2^3+b2^2+c2+d}&=&{5} \\ 
  {a3^3+b3^2+c3+d}&=&{14} \\ 
  {a4^3+b4^2+c4+d}&=&{30} 
\end{eqnarray*} 
Now this is easy, we need only to find the coefficients $a,b,c,d$, that is, find the inverse of a matrix $A$ in the matricial equations $Ax=b$:
$$\left(
\begin{array}{cccc}
 1 & 1 & 1 & 1 \\
 2 & 4 & 8 & 16 \\
 3 & 9 & 27 & 81 \\
 4 & 16 & 64 & 256 \\
\end{array}
\right)$$
And then: $x=A^{-1}b$. This gives me:
$$a=\frac{1}{3}\quad\quad  b= \frac{1}{2}\quad\quad  c= \frac{1}{6}\quad\quad   d= 0$$
That is, our polynomial is: $\cfrac{x^3}{3}+\cfrac{x^2}{2}+\cfrac{x}{6}$ and this is - at least to me - surprising because it is the formula for the sum of the first $n$ square numbers. What baffles me more is that if I do the same with a polynomial of degree $4$ and a $5\times 5$ matrix and $f(5)=55$ it will give me the same formula. So I have three questions:

  
*
  
*When I did this trick, I used only $4$ and $5$ values of the sum of the first $n$ squares. So why does it give me exactly the polynomial for the sum of the first $n$ squares instead of any other polynomial? There is an infinite abyss of possible polynomials, why exactly this one? For example: Why didn't it give a polynomial that gives me:
  
  
  $$f(1)=1, \quad f(2)=5,\quad  f(3)=14,\quad f(4)=30 \quad f(5)=55\quad  f(6)=2\quad ?$$

  
*Why does the result holds for a higher $n$, that is: Why doing the same thing with $n+1$ gives me the same polynomial it gave me for $n$ instead of any other polynomial in the behemothic chasm of possible polynomials?
  
*I've tried for other formulas in the past, just like the sum of the first $n$ positive integers. Why does it hit exactly the polynomial for the sum of the first $n$ positive integers instead of any other polynomial in the humongous crevasse of possible polynomials?

Sorry if the question is too stupid, but I've figured this trick some time ago and couldn't find a clue to why this is hapenning. The main drama of the thing for me is that it seems as if I were doing incomplete induction and then BAM! it just hits exactly where I wanted it to hit.

This is an example of working out Ahmed's answer, which is good and contains a lot of information.
This trick works best if you start from $0$. To find the polynomial $f(x)$ with $$f(0) = 0, \; f(1) = 1, \; f(2) = 5, \; f(3) = 14, \; f(4) = 30,$$ form a triangle of differences
\begin{align*} &0\quad \quad 1 \quad\quad 5 \quad\quad 14 \quad\quad 30 \\ &\quad 1 \quad\quad 4 \quad\quad 9 \quad\quad 16 \\ &\quad\quad 3 \quad\quad 5 \quad\quad 7 \\ &\quad\quad\quad 2 \quad\quad 2 \\ &\quad\quad \quad\quad 0\end{align*}
and take the left side of the triangle as coefficients in a Newton series:
\begin{align*} f(x) &= 0 \binom{x}{0} + 1 \binom{x}{1} + 3 \binom{x}{2} + 2 \binom{x}{3} + 0 \binom{x}{4} \\ &= 0 + x + \frac{3x (x-1)}{2} + \frac{2 x(x-1)(x-2)}{6} \\ &= \frac{x}{6} + \frac{x^2}{2} + \frac{x^3}{3}.\end{align*}
