This comes from the rational parameterization of the unit circle: namely,
the circle $x^2 + y^2 = 1$ can be parameterized by (put in bijection with) the $t$-line via the formula $x = (1-t^2)/(1+t^2),$ $y = 2t/(1+t^2).$
This substitution goes back in some form to Euclid, at least, who used it to
generate Pythagorean triples. (If we take $t$ to be a rational number $m/n$ and clear demoninators, we find that $(m^2 - n^2)^2 + (2 m n)^2 = (m^2 + n^2)^2$, and all Pythagorean triples arise in this way.)
The intuition for this formula is as follows: the curve is cut out by a degree two (i.e. quadratic) equation in $x$ and $y$, so a line will meet it in two points. So, if we fix one of the points and let the other point vary, we can describe all the points on the circle as being obtained by intersecting the circle with a varying family of lines passing through a fixed point.
More precisely and concretely, take the base point to be $(-1,0)$. Then if we
consider the line of slope $t$ through this point, it meets the circle in the point $(0,1)$ (obviously) and one other point, namely $\bigl((1-t^2)/(1+t^2), 2t/(1+t^2) \bigr).$ This gives the formula.
The trignometric point of view, which historically came later, just comes
from writing $x = \cos \theta,$ $y = \sin \theta$. If you draw the triangle whose vertices are $(-1,0),$ $(1,0),$ and $(x,y)$, then this a right triangle with angle $\theta/2$ at the vertex $(-1,0)$, so its slope $t$ is equal to $\tan \theta/2$.
Note that this trick of fixing one point and then parameterizing the other points by drawing a line joining the fixed point to another point on the curve only works when the curve has degree $2$. If the degree is larger, than a line through the fixed point will meet the curve in more than one other point.
Thus there is no obvious way to parameterize higher degree curves by a single variable, and in general this can't be done (except in some degenerate singular cases, like parameterizing $y^2 = x^3$ via $(t^2,t^3)$).
This means that there is no rational substitution available to
convert an integral like (just to give one famous example) $$\displaystyle \int \frac{dx}{\sqrt{(1-x^2)(1 - k^2 x^2)}}$$
(which is related to the degree $4$ curve $y^2 = (1- x^2)(1-k^2 x^2)$)
into an integral of rational functions.
This integral is known as an elliptic integral, and studying them and trying to understand the algebraic curves that underly them, led to the development of much of modern algebraic geometry and algebraic topology (the key names, that transformed their study from a branch of analysis to geomery/topology, are Abel, Jacobi, and Riemann).
I have a few different answers here related to this theme.