Likely not very satisfying, but a simple sufficient (and in fact necessary) condition for both is that $\max_{x\in K} f(x) = \max_{x\in K'} f(x).$ Note also that the two results you are looking for are equivalent.
Suppose $\arg\max_{x\in K} f(x) \cap K'\neq \emptyset,$ then there exists $x^*\in K'$ such that $f(x^*) = \max_{x\in K}f(x).$ We can combine this with $\max_{x\in K} f(x) \geq \max_{x\in K'} f(x),$ to obtain that
$$\max_{x\in K'} f(x) \geq f(x^*) = \max_{x\in K} f(x).$$
In particular, for all $x'\in \arg\max_{x\in K'} f(x),$ we have $f(x') = \max_{x\in K'} f(x) = \max_{x\in K} f(x).$ Hence also $x'\in \arg\max_{x\in K} f(x)$ (and in particular $x'\in \arg\max_{x\in K} f(x)\cap K'$).
The converse is much easier to show (thanks to OP for noticing!). Note that by compactness, $\arg\max_{x\in K'}f(x) \neq \emptyset,$ so $\arg\max_{x\in K'}f(x) \subset \arg\max_{x\in K}f(x) \cap K'$ immediately implies that the RHS is non-empty.
The converse - $\arg\max_{x \in K'}f(x) \subset \arg\max_{x \in K}f(x) \cap K' \Rightarrow \arg\max_{x \in K}f(x) \cap K' \neq \emptyset$ - seems strange to me because $\arg\max_{x \in K'}f(x)$ is nonempty, so the right-hand side of the implication is true only in the case where $\arg\max_{x \in K}f(x) \cap K' \neq \emptyset$ ?!
– deeppinkwater Jun 08 '20 at 13:49