An open covering of a space $X$ is a collection $\{U_i\}$ of open sets with $\displaystyle X=\bigcup_{i\in I}U_i$.
If $X$ is compact, for every open cover there exist at least a finite subcover, so this happens $X\displaystyle= \bigcup_{i=1}^nU_i.$
However with 1. and 2. aren't we saying that $$\displaystyle \bigcup_{i\in I}U_i= \bigcup_{i=1}^nU_i$$
?
But this means that the union of open sets (maybe not finite) is equal to the union of finite open sets.
Why does that happen?
Beware that you can see "compactness" defined either for a subset of a topological space, or for a topological space itself. The two definitions are equivalent (in that a subset of a topological space is compact as a subset if and only if it is compact as a space in its own right with the subset topology), but the details are subtly different and should not be mixed up.
If $X$ is just a subset, then there's no reason to except that the finite union equals $\bigcup_I U_i$, becuase $\bigcup_I U_i$ can contain points outside $X$ that are not in the finite union.
On the other hand, if $X$ is the entire topological space, then every $U_i$, and therefore also their union, is by definition a subset of $X$. In that case, claiming that $X\subseteq \bigcup_{\rm finite}U_i$ is the same as claiming that $X=\bigcup_{\rm finite}U_i$, and that is how the definition would usually be phrased. Since we then, obviously, have $$ X = \bigcup_{\rm finite}U_i \subseteq \bigcup_I U_i \subseteq X $$ this forces the finite and infinite union to equal each other.
You then ask,
The best answer I can think of to that is: It doesn't necessarily. But when it does happen for all open covers -- and only then! -- we call the space compact. That's what "compact" means.