What is the motivation for Liu's definition of an algebraic variety? I'm currently trying to understand the motivation for Liu's definition of an algebraic variety and in particular, how it arises from and generalises Milne's definition. The question is actually motivated by the accepted answer of What is an algebraic variety? where the two definitions are stated as follows (I have included the classical definition for the purpose of readability):

"Classical" definition (affine case): A $k$-variety is an irreducible Zariski-closed subset of $k^n$ for an algebraically closed field $k$ and some integer $n$.
Milne's definition (affine $k$-variety): An affine $k$-variety is a locally ringed space isomorphic to $(V,\mathcal{O}_V)$ where $V\subset k^n$ is a "classical" $k$-variety and $\mathcal{O}_V$ is the sheaf of regular functions on $V$.
Liu's definition: An affine $k$-variety is the affine scheme $\operatorname{Spec} A$ associated to a finitely generated reduced $k$-algebra $A$.

I would guess that the requirement of $A$ being finitely generated is supposed to generalise $k[X_1,\ldots,X_n]$ and quotients thereof but I'm not sure. Moreover, why does $A$ have to be reduced? I really don't understand that requirement.$^1$
Question: How does Liu's definition arise from the one given by Milne?

$^1$Liu also seems to drop the requirement of $k$ being algebraically closed but as far as I know, this is in order to be closer to number theory.
 A: Milne is the same as Liu+irreducible+algebraically closed. Finitely generated as an algebra exactly means “quotient of $k[x_1,...,x_n]$ for some n”. Reduced means no nilpotents, which one might want because a regular function has codomain a field and so it can’t be nilpotent.
So Liu allows for possibly non algebraically closed fields - as you say, these tend to pop up in number theory. Additionally, Liu allows reducible schemes, so it might have multiple components. The last isn’t a huge generalization since each irreducible component be treated separately (under most circumstances).
A: Here's some motivation for the scheme-theoretic approach, to supplement TokenToucan's correct answer.  Quoting from the introduction to Vakil's book:

The intuition for schemes can be built on the intuition for affine
complex varieties. Allen Knutson and Terry Tao have pointed out that
this involves three different simultaneous generalizations, which can
be interpreted as three large themes in mathematics. (i) We allow
nilpotents in the ring of functions, which is basically analysis
(looking at near-solutions of equations instead of exact solutions).
(ii) We glue these affine schemes together, which is what we do in
differential geometry (looking at manifolds instead of coordinate
patches). (iii) Instead of working over $\mathbb C$ (or another
algebraically closed field), we work more generally over a ring that
isn’t an algebraically closed field, or even a field at all, which is
basically number theory (solving equations over number fields, rings
of integers, etc.).

Both Milne's and Liu's definitions can be thought of as coordinate-free abstractions of the classical definition (with the caveats that TokenToucan mentioned).  Given a finitely generated $k$-algebra $A$, we can impose coordinates as follows:  choose a natural number $n$ and a surjection $k[X_1, \dots, X_n] \to A$ with some kernel $I = (f_1, \dots, f_m)$.  Then $\mathrm{Spec} A$ corresponds to the variety cut out from affine $n$-space by the polynomial equations $f_1 = \cdots = f_m = 0$.  But the definition of $\mathrm{Spec} A$ does not rely on a choice of coordinates, and this makes many things much simpler and cleaner:  identifying the right notion of morphisms, gluing affine patches together, etc.
As for reducedness:  as Eric Towers mentioned in a comment, $x = 0$ and $x^2 = 0$ define two different subschemes of $\mathbb A^1_k$, corresponding to the $k$-algebras $k[x]/(x) = k$ and $k[x]/(x^2)$.  The latter has nilpotents.  Although it's actually extremely useful to allow nilpotents in algebraic geometry (for example:  a map from $\mathrm{Spec} k[x]/(x^2)$ to a $k$-variety $Y$ is the same thing as a choice of $k$-point of $Y$ equipped with a tangent vector), we reserve the term "variety" for things that fit well into the classical solution-set picture of algebraic geometry.  In the classical picture, it is certainly true that if $f$ is a function on a variety and $f^n = 0$ for some $n > 0$, then $f = 0$.
As for non-algebraically closed fields, you are correct that they're relevant to number theory.  The abstraction from solution sets of polynomials in $k^n$ to schemes is really necessary for this.  Consider the varieties over $\mathbb Q$ defined in $\mathbb A^2$ as $X = (x^2 + y^2 = -1)$ and $Y = (y^2 = x^3 + 1)$.  The first equation has no rational solutions, while the second has five.  But $X$ and $Y$ are both given by imposing one non-constant equation on two variables, so they shouldn't be empty or discrete point sets; they should be "curves", whatever that means.  (They're affine patches, respectively, of a twist of $\mathbb P^1$ and an elliptic curve.)  In order to understand them as curves--and especially to understand the right notion of morphisms between them--we need to see that $k$-varieties are more than just their $k$-points.
