You are asked to optimize $$Z= 4x_1x_2 + x_1$$ subject to:
$$\begin{align} x_1 &\le 5 \tag1\\ x_1 + x_2 &= 10 \tag2\\ x_2 &\ge 0 \tag3 \end{align}$$
As a result our whole equation becomes
$$L= (4x_1x_2 + x_1) + \lambda_1(5- x_1 - x_3^2) + \lambda_2(10- x_1 - x_2) + \lambda_3(x_2 - x_4^2)$$
I want to know how $(1)$ becomes $x_1 + x_3^2 = 5 \to 5- x_1 - x_3^2 = 0$. Why do we have the $x_3^2$ there?
Same for $x_2 \ge 0 \to x_2 - x_4^2 = 0$. Why is the $x_4^2$ there?
The only part I understand is $(2)$ where we get $10- x_1 - x_2 = 0$
An inequality constraint $f(x) \geq c$ can be imposed as an equality constraint $f(x)-c=y^2$, where $y$ is a new variable (called a slack variable) which is otherwise not constrained by the problem. The key is that no matter what $y$ is, $y^2 \geq 0$, so this equality constraint forces $f(x)-c$ to be some nonnegative number without imposing any other requirements. This is exactly what you want to achieve.
In your problem you just do this twice, setting $5-x_1-x_3^2=0$ and $x_2-x_4^2=0$. Note that you need two different slack variables (one for each inequality constraint) so that you do not accidentally force $5-x_1$ to be equal to $x_2$.