Maybe it's silly to add this as a separate answer, since NoahNoah basically said what I would have, but he didn't emphasize the one-sentence version of the answer: "the dimension of a subspace is the trace of the projection to that subspace."
That and linearity are what's special about trace.