The "Heine–Cantor theorem" states: If $f : M → N$ is a continuous function between two metric spaces, and $M$ is compact, then $f$ is uniformly continuous.
I do not doubt its validity, of course, just trying to understand why it is valid.
If we, say, take the function: $y = x^4$. It rises very quickly with the rising value of the argument. How is it that according to Heine–Cantor theorem just because we enclose the argument of the function, say, between $[0, 10]$ it automatically becomes "uniformly continuous" (considering of course that it is "continuous")?
There are areas of function values inside the argument segment where function will rise quicker than in some other areas.
Does the reason have to do with the fact that we could in worst case choose $\delta=10$ (length of the segment in example) and thus cover all possible cases for $\varepsilon$?
Compactness is a finiteness property. It says that given any infinite collection of data associated to open sets in a topological space, you can in fact deal with only finitely many.
The great thing about a finite number of objects, is that you can compare them. Unlike with infinite sets, which only have well-defined suprema and infima, finite sets have maxima and minima (infinite sets can have these, but often don't, such as with sets like $(0,1)$, which has no maxima or minima).
Uniform continuity is a statement that one particular $\delta$ works for every $x$. Compactness says finitely many $\delta$ suffice to talk about the $\delta$'s needed for the whole space. So the finiteness lets us pick the one we need for the whole space.