I've seen on MathSE that a subset of a compact set need not be compact. However, I am not fully understanding why.
If $X$ is compact then there exists a finite subcover, i.e., $X \subseteq \bigcup_{i=1}^n U_i$. So any subset of $X$, say $K$, will be a subset of the finite union of $U_i$.
So why is not the case that $K$ is automatically compact?
What you've shown is that any open cover $\mathcal{A}$ of $K$ has a finite subcover . . . if $\mathcal{A}$ is also a cover of $X$! But that need not happen. For a concrete example, consider $K=(0, 1)$ as a subset of $X=[0, 1]$. Then $\mathcal{A}=\{({1\over n}, 1-{1\over n}): n\in\mathbb{N}\}$ is a cover of $K$ with no finite subcover. Note that $\mathcal{A}$ fails to cover $X$, but there was no reason for it to cover $X$ in the first place.