Usually in algebraic geometry,we define the dimension of a topological space as follows:
$\dim(X)=\sup\{ m:\text{ there exists a descending chain of irreducible closed sets of length } m\}$
and in a commutative ring $R$ ,we define the Krull dimension as follows:
$\dim(R)=\sup\{m': \text{ there exists an ascending chain of closed sets of length } m'\}$
I know that there exists a correspondence between irreducible closed sets of $\mathbb A^n_K$ and the prime ideals of $K[X_1,X_2,...,X_n]$ for an algebraically closed field $K$, so via the correspondence we can get one from the other. But what motivated one of the definitions is not clear to me. Can someone help me with this?