a classifying space
Suppose you want to list, once and for all, every rank-n bundle that could ever live over any space — and to do it not space by space but with a single master object. A classifying space is that master object. It is a space, written BG (for a structure group G) or BO(n), BU(n) for real and complex vector bundles, that carries one universal bundle, with the magic property that every bundle anywhere is a pullback of the universal one, in a unique way up to homotopy.
Precisely: for a topological group G there is a space BG and a universal principal G-bundle EG -> BG, where EG is contractible. The classification theorem says that for paracompact X, isomorphism classes of principal G-bundles over X are in natural bijection with homotopy classes of maps [X, BG], the bijection sending a map f to the pullback f^*(EG). For rank-n real vector bundles take G = O(n) and BO(n); for complex take U(n) and BU(n). To classify all bundles of any rank stably, one passes to the limits BO = colim BO(n) and BU = colim BU(n). Concretely BU(n) is realized as the infinite complex Grassmannian of n-planes, and a map X -> BU(n) is literally a continuous rule assigning to each x in X an n-plane in C-infinity, which is just naming the fiber of a bundle.
The payoff is that a geometric question (which bundles exist?) becomes a homotopy question (what are the maps into BG?), and characteristic classes are simply the pullbacks of fixed cohomology classes living on BG. So H^*(BG) is the home of all characteristic classes at once: H^*(BU(n)) is a polynomial ring on the Chern classes, H^*(BO(n); Z/2) is polynomial on the Stiefel-Whitney classes. A frequent confusion is to think BG is unique as a space; it is unique only up to homotopy equivalence, and different models (Milnor's join construction, the bar construction, the Grassmannian) all serve.
Complex line bundles (rank 1) over X are classified by [X, BU(1)]. Here BU(1) is the infinite complex projective space CP-infinity, which is also an Eilenberg-MacLane space K(Z, 2). So line bundles over X correspond exactly to H^2(X; Z), the correspondence being the first Chern class c_1. A line bundle is, homotopically, nothing more than a degree-2 integral cohomology class.
BU(1) = CP-infinity = K(Z,2): line bundles are H^2 classes via the first Chern class.
BG is defined only up to homotopy equivalence — there is no single 'the' classifying space, just models that agree homotopically. Also, the classification needs X paracompact; for general spaces the bijection [X,BG] <-> bundles can fail.