Let me first answer this question in more generality.
Let $E$ be a vector bundle over a base manifold $M$, then $E$ is associated to the principal bundle of linear frames $GL(E)$, and every covariant derivative on $E$ induces a connection on $GL(E)$. Indeed, taking a cover of $GL(E)$, $\{U_i,e^i\}$, where $e^i=(e^i_1,\dots, e^i_n)$ is frame for $E$ over $U_i$, and fixing a covariant derivative $\nabla$ on $E$, we can write $\nabla$ in each local frame via:
$$\nabla e^i_k=\xi^a_k\otimes e^i_a$$
We can then take the matrix valued one form $\xi=(\xi^a_k)$. If $\mu_{GL}$ is the Maurer-Cartan form on $GL_n$, $\phi_i$ is the trivialization of $GL_n(E)$ induced by $e^i$, and $\pi_{GL}:U_i\times GL_n\rightarrow GL_n$, $\pi_{U_i}:U_i\times GL_n\rightarrow U_i$ are the projections, we define a connection one form on $GL(E)$ locally by:
$$A|_{\pi^{-1}(U)}=\phi_i^*(\pi_{U_i}^*\xi+\pi_{GL}^*\mu_{GL})$$
These then glue together to form a global connection one form $A$ on $GL(E)$ as one can check.m
Now, if $E$ admits a $G$ structure, then there is some representation $\rho:G\rightarrow GL(\mathbb R^n)$, and a cover by trivialization such that the transition functions take values in $\rho(G)$. We can thus get a new principal bundle $G$-frame bundle $G(E)$ where the action on the frames is now given by the Lie group $G$. As an example, we can always equip $E$ with an orthogonal structure, and then obtain the bundle of orthonormal frames, $O(E)$, where the transition functions take orthonormal frames to orthonormal frames, and thus lie in the group $O(n)$. In this case, we can only lift a covariant derivative to the principal bundle $O(E)$ if, when writing the covariant derivative in an orthonormal frame, we have that $\xi^a_k+\xi^k_a=0$; in other words $\xi$ is a matrix valued one form with values in the Lie algebra $\mathfrak{o}(n)$. Note that this is an if and only if condition, if $\nabla$ induces a connection in $O(E)$, then if every orthonormal frame we have that the matrix one forms take values in $\mathfrak o(n)$.
Going back to the abstract case, suppose we have a $G$ structure on $E$, and consider the princpal $G$-frame bundle $G(E)$. We have a representation $\rho:G\rightarrow GL_n$, and this gives an induced representation $\rho_*:\mathfrak g\rightarrow \text{Mat}_{n\times n}(\mathbb R^n)$. We can now try and play the same game and claim that we can lift the covariant derivative to a connection one form if and only if the matrix valued one forms have components which lie in $\rho_*(\mathfrak g)$ for every local $G$-frame (by which I mean a frame of the form $e_i=[s,u_i]$ where $u_i$ is the standard basis vector on $\mathbb R^n$), however this does not always work. Suppose that we have a connection on $E$, and $U$ and $V$, such that $U\cap V\neq \emptyset$, with sections $s_U,s_V$ from $U,V\rightarrow P$, and local connection forms $\xi_U$ and $\xi_V$ which can be written as $\rho_*(A_U)$ and $\rho_*(A_V)$ for some $\mathfrak{g}$ valued one forms $A_U$ and $A_V$. Then it need not be the case that $A_U$ and $A_V$ glue together as $\rho_*$ may not be injective. We then need the extra condition that we can find $A_U$ and $A_V$, such that if $g:U\cap V\rightarrow G$ is the map satisfying $s_U=s_V\cdot g$, then:
$$A_U=\text{Ad}_{g^{-1}}\circ A_V+g^{-1}\mu_G$$
where $\mu_G$ is the Maurer-Cartan form on $G$.
Let us now start with a principal $G$ bundle $P\rightarrow M$, then we have that the adjoint bundle is associated $\text{Ad}(P)$ is the vector bundle associated to $\mathfrak{g}$ the adjoint representation of $G$ on $\mathfrak g$. The adjoint presentation is a Lie group homomorphism $G\rightarrow GL(\mathfrak g)$, and an induced representation $\mathfrak{g}\rightarrow \text{End}(\mathfrak g)$. Fix a covariant derivative $\nabla$ on $\text{Ad}(P)$, and let $\xi$ be the local connection one form for a local $G$-frame (that is one of the form $e=[s,u]$, where $s$ is a section of $P$, and $u$ is a frame of $\mathfrak{g}$) on $\text{Ad}(P)$. Then, we can obtain a connection one form on $P$ if and only if in every such frame, for all $X\in \mathfrak{X}(U)$, and all $\Phi\in \Gamma(\text{Ad}(P),U)$ we have that:
$$\xi\cdot \Phi=[\beta,\Phi]$$
for some one form $\beta$ with values in $\mathfrak{g}$, where each $\beta$ satisfies the appropriate transformation law. If the adjoint representation $\mathfrak{g}\rightarrow \text{End}(\mathfrak{g})$ is injective, then we get the compatibility condition for free so it suffices to just check that we can write $\xi\cdot \Phi$ as this in every local $G$-frame.
Edit: Note that $\text{Der}(\mathfrak{g})\subset \text{End}(\mathfrak{g})$ so if $G$ is semisimple, then $\text{ad}:\mathfrak{g}\rightarrow \text{End}(g)$ is injective as it is an isomorphism onto it's image, so Claire's answer is a special case of the above discussion.