Definition. A compact object is an object representing a copresheaf which commutes with filtered colimits.
In algebraic categories, the compact objects are the finitely presented ones, so commuting with filtered colimits somehow yields a notion of smallness. Every time I skim over proofs of these I forget them because I don't understand the idea.
How, intuitively, does commuting with filtered colimits capture a notion of "smallness"?
The $n$Lab article on compact objects gives a good explanation. The first thing you should understand are what filtered colimits are. The most basic example of a filtered colimit is a colimit indexed by $\mathbb{N}$: basically, you're looking at a space $X$ which is the increasing union of subspaces, $X = \bigcup_{n \in \mathbb{N}} X_n$.
From a topological point of view, the rough idea is that the image of a compact set by a map $Z \to X$ is compact, and so can only meet a finite number of the $X_n$. Thus it factors through $\bigcup_{n \le N} X_n = X_N$ for some $N$ big enough, and this precisely means that $$\hom(Z, \bigcup_{n \in \mathbb{N}} X_n) = \bigcup_{n \in \mathbb{N}} \hom(Z, X_n).$$
But there are more general shapes of diagrams for which you can say things like "a compact set only meets a finite number of parts". The first generalization is a directed set, a preordered set where any finite subset has an upper bound. So in our example, the union may not necessarily be increasing, and so the $X_i$ are not totally ordered for inclusion; they're now indexed by some preordered set $I$ and $i \le j \implies X_i \subset X_j$. But if you take two of them, say $X_i$ and $X_j$, then there's a $k$ for which $X_i \cup X_j \subset X_k$. Then if $X = \bigcup_{i \in I} X_i$, then a compact subset of $X$ can only meet a finite number of the $X_i$, say $X_{i_1}, \dots, X_{i_k}$ and since the set is directed there's some $X_l$ containing all the $X_{i_j}$. You then get the same commutation with the colimit as before.
Now there's something even more general than a directed set, and it's a filtered category. It's not necessarily a preorder anymore (there may be more than one arrow between any two objects), but there's still a condition reminiscent of the "any finite subset has an upper bound": any finite diagram has a cocone. As it turns out, a similar type of argument as before will let you say something similar to prove that a compact subspace will only "meet a finite number of parts", and $\hom(Z,-)$ will commute with the colimit if $Z$ is compact.
And now what's really nice is that the converse becomes true: if $Z$ is such that $\hom(Z,-)$ commutes with all filtered colimits, then $Z$ has to be compact.