A space X is compact if every open cover of X has a finite subcover. Compactness generalizes the Heine–Borel property and is preserved by continuous images.
From your study of open sets in topology, you know that a topology on a set X is a collection of "open" subsets satisfying certain axioms — arbitrary unions and finite intersections of open sets remain open. Crucially, you have no notion of distance, length, or boundedness in a general topological space. So when you want to capture the idea that a space is "small" or "finite-like" in a topologically meaningful way, you cannot say "bounded" — you have to express the idea purely in terms of open sets. Compactness is the result: a space is compact if whenever you cover it with open sets, some finite subcollection already covers it.
To build intuition, think about why finite spaces are trivially compact: if X = {p₁, p₂, …, pₙ} and you cover X with any collection of open sets, each pᵢ must be in at least one open set, so picking one open set per point gives a finite subcover. Compact spaces generalize this "finiteness" to infinite spaces — even infinitely many points, the space behaves as if it has finitely many. The canonical non-example is any non-compact space where you can build an "escaping cover" with no finite subcover, like covering the real line with (−n, n) for n = 1, 2, 3, …: every point is eventually inside some (−n, n), but no finite subcollection covers all of ℝ.
The definition pays off immediately through the continuous image theorem: if f: X → Y is a continuous surjection and X is compact, then Y is compact. The proof is a direct translation of definitions — pull back any open cover of Y to an open cover of X (possible because f is continuous and surjective), extract a finite subcover of X, then push it back forward to a finite subcover of Y. This result is purely topological: it uses only the definition of continuity (preimages of open sets are open) and the definition of compactness (finite subcovers exist). No distances, no coordinates — just open sets.
The relationship to Heine–Borel is the bridge between this abstract definition and the concrete real-analysis setting you may also know. In ℝⁿ with the standard topology, a subspace is compact if and only if it is closed and bounded. But in a general topological space, "closed and bounded" has no meaning — you need a metric to define distance and therefore boundedness. The open cover definition is primary because it works in every topological space. When you move to metric spaces, compact there turns out to be equivalent to sequential compactness (every sequence has a convergent subsequence), providing another way to characterize the same idea. But in the purely topological setting, the open cover definition is all you have, and it is exactly what you need: a precise, coordinate-free way to say that a space cannot be infinitely "spread out."