In Kobayashi and Nomizu's Foundations of Differential Geometry vol. 1 the authors define immersed principal subbundles (actually, they call them imbeddings) of a principal $G$-bundle $\pi: P \to M$ as a principal $G'$ bundle $\pi': P' \to M'$ with an injective immersion $f: P' \hookrightarrow P$ and an injective homomorphism of Lie groups $\phi: G' \hookrightarrow G$ such that $$ f(q \cdot g) = f(q) \phi(g) \quad \text{for all}~q \in P', g \in G'~. $$ This induces a smooth map $h: M' \to M$ such that $h \circ \pi' = \pi \circ f$. The authors claim that (in the case of a immersed subbundle) this is also an injective immersion.
I don't see why the last statement should hold. Take for example $M' = \mathbb{R}$, $G' = \{e\}$, so $P' = \mathbb{R} \times \{e\}$ and $P = \{p\} \times \mathbb{R}^2$, i.e. $M$ is a single point and $G = (\mathbb{R}^2, +)$. Then the map
\begin{align} \mathbb{R} \times \{e\} &\to \{p\} \times \mathbb{R}^2 \\ (t, e) &\mapsto (p, (t, 0)) \end{align}
satisfies the conditions to be an immersed principal subbundle. However the map induced on $\mathbb{R} \to \{p\}$ is not an injective immersion. Am I missing something (an additional assumption, a different definition)? If not, is there any assumption that can be added to make the claim in the book true?
You're exactly correct. Their definition allows you to switch the rôle of base and fiber (you could have taken $G=\Bbb R$ instead of $\Bbb R^2$), which is clearly not what they intended. Of course, they were thinking of immersing $M'$ in $M$ and $G'$ in $G$, and your example shows that immersing $P'$ in $P$ certainly does not suffice. I suspect that in their applications they will have $M'$ immersing into $M$ in the first place. Can you chase down the appearance in the theory of connections to which they refer and edit your question?