While trying to understand a different problem I read a few pages in Spivak's A Comprehensive Introduction to Differential Geometry Vol. 5. I realized that there are basically two different ways of seeing the curvature forms. I am comfortable with the first, but have problems with the second.
In the first way the curvature forms $(\Omega^i_j)$ associated to a local frame $(s_i)$ are given by $$ R(X,Y)s_j=\sum_i\Omega^i_j(X,Y)s_i, $$ where $R(X,Y)s=\nabla_X\nabla_Ys-\nabla_Y\nabla_Xs-\nabla_{[X,Y]}s$. So in this approach we view a connection as a way of differentiating sections (of a vector bundle). Since most of my knowledge in differential geometry comes from Riemannian Geometry I feel pretty comfortable with this.
However, I have problems understanding the other approach. I realize that the other approach works in the general setting of principal $G$-bundles, but I don't see how it is exactly related to the first approach in the case of principal $GL_k(\mathbb{R})$-bundles (i.e. $k$-dim. vector bundles) or principal $O(k)$-bundles (if the vector bundle is equipped with a Riemannian metric).
For a principal $G$-bundle one considers the Ehresmann connection (a concept that I don't understand) $\omega$, which is a $Lie(G)$-valued 1-form, and defines $$ \Omega=d\omega+\frac{1}{2}[\omega \wedge \omega]. $$ More specifically, I would be glad for explanations how (and why) in the case of a Riemannian manifold $M$ and the principal $O(n)$-bundle of orthonormal frames $\varpi: O(TM)\to M$, the curvature form $\Omega$ defined using the Ehresmann connection is related to the pullbacks $$ \varpi^*\Omega_j^i $$ of the 2-forms $\Omega_j^i$ on $M$ given by the first approach. Also what changes if we consider a oriented Riemannian manifold and the principal $SO(n)$-bundle of positively oriented orthonormal frames $SO(TM)\to M$?
Thanks in advance!