The basic concept: when we work with a Hilbert space of functions, we want to have an orthonormal basis that consists of particularly simple functions. The trigonometric (or complex exponential) basis works very well for $L^2([a,b])$. But algebraic polynomials can serve this purpose too. Since polynomials are not integrable over unbounded intervals, one includes a weight such as $w(x)=e^{-x}$ on $[0,\infty)$ or $w(x)=e^{-x^2}$ on $\mathbb R$. Then the monomials $1,x,x^2,\dots$ are elements of the weighted Lebesgue space $L^2_w = \{f:\int |f|^2 w<\infty\}$. Applying the Gram-Schmidt process to the sequence of monomials produces an orthonormal sequence, which in many cases turns out to be complete, i.e., an orthonormal basis. With the weights I mentioned above we get the Laguerre and Hermite polynomials, respectively.
Orthogonal polynomials have a large number of interesting properties, many of which are easily proved by induction. Recurrence relations, for example: polynomials of different degrees turn out to be related via linear combinations involving derivatives. Also, they usually satisfy a simple differential equation with degree $n$ as parameter, which can be used as a shortcut to quickly define the polynomials (without going through Gram-Schmidt, etc).
Further reading: you can start with the short Wikipedia article Orthogonal polynomials and proceed to the references listed there, out of which I recommend the classical book by Szegő, Orthogonal polynomials.