So I am trying to understand the connection between The principle of least action or Hamilton's principle and variational calculus. In my book, "Analytical Mechanics by Hand and Finch, page 46", it is mentioned that Euler derived the modern form of variational calculus. His attempt was to: "Given a known function $F(y,\frac{dy}{dx}, x)$ of an unknown curve $y(x)$ and its first derivative $\frac{dy}{dx}$, find the curve which makes the integral $I(y)$ an extremum: $$I(y) = \int_{x1}^{x2}{F(y,y',x) dx} \tag{2.1}$$
It is then mentioned that a small variation in the curve $y(x)$ can produce only second-order variations in the integral. Now, I don't understand why would that be the case? How does one reach that conclusion? Is it connected to Taylor series? Also why is that important?