I'm trying to understand the proof of the fact that if I have a continuous map between two topological spaces $X$ and $Y$, then the image of a compact subset $A \subseteq X$ is compact in $Y$. The proof for this statement is already provided at this link Proving continuous image of compact sets are compact.
Now what I don't understand is why if a set $\{V_i \} $ is an open cover for $f(A) \subseteq Y$, then $A \ \cap \ f^{-1}(V_i)$ forms an open cover for $A$. I'm aware that the $\{f^{-1}(V_i)\}$ must be open because $f$ is continuous but don't see the connection. I mean what guarantees that these open sets cover the entire subset $A$.