Let $\theta:G\rightarrow H$ be a morphism of Lie groups.
Given $G$ we have classifying space $BG$ and given $H$ we have classifying space $BH$. This $\theta:G\rightarrow H$ gives a map $B\theta:BG\rightarrow BH$ (I do not fully know how this is done).
Given $G$ we have collection of principal $G$ bundles, denoted by $\text{Prin}(G)$ and given $H$ we have collection of principal $H$ bundles, denoted by $\text{Prin}(H)$.
There is what is called an associated bundle construction which associates for each principal bundle $P\rightarrow M$, a principal $H$ bundle $(P\times H)/G\rightarrow M$.
This gives a map $\text{Prin}(\theta):\text{Prin}(G)\rightarrow \text{Prin}(H)$.
Let $\pi:P\rightarrow M$ be an element of $\text{Prin}(G)$. This is associated to a map $f:M\rightarrow BG$ where pullback of $EG\rightarrow BG$ along $f:M\rightarrow BG$ is the map $P\rightarrow M$.
We already know the map $B\theta:BG\rightarrow BH$. Consider the composition $B\theta\circ f:M\rightarrow BH$. Pullback the principal $H$ bundle $EH\rightarrow BH$ along $B\theta\circ f:M\rightarrow BH$ to get a principal $H$ bundle $Q\rightarrow M$. I am sure this is the same (isomorphic) to the bundle $(P\times H)/G\rightarrow M$.
So, $B\theta:BG\rightarrow BH$ gives $\text{Prin}(\theta):\text{Prin}(G)\rightarrow \text{Prin}(H)$.
Similarly, $\text{Prin}(\theta):\text{Prin}(G)\rightarrow \text{Prin}(H)$ gives $B\theta:BG\rightarrow BH$.
Question : Historically, which construction came first? Is the map $BG\rightarrow BH$ defined before or the associated bundle construction? Suppose $BG\rightarrow BH$ is known before, Is associated bundle construction $\text{Prin}(\theta):\text{Prin}(G)\rightarrow \text{Prin}(H)$ was motivated in the way I mentioned above?.