Reference: A Differential Approach To Ax-Schanuel, I
Let \(G\) be an algebraic group, \(Y\) a smooth irreducible algebraic variety, \(\pi:P\to Y\) a principal bundle over \(G\) with right action denoted by \(R\). By definition of principal bundle we have an isomorphism
\[ P \times G \cong P \times_Y P : (p,g) \mapsto (p, R_g(p)) \]
where \(R_g\) is the right action of \(g\in G\) on \(P\). It intuitively means two points in \(P\) in the same fibre is the same as one point in \(P\) with a difference in \(G\).
The fibres of \(\pi\) are principal homogeneous \(G\)-spaces. If we fix a point \(p\) in a fibre \(P_y = \pi^{-1}(y)\), then we can identify the homogeneous space \(P_y\) with \(G\)
\[ G \cong P_y : g \mapsto R_g(p).\]
We also have an isomorphism of groups
\[G\xrightarrow{\sim} \mathrm{Aut}_G(P_y) : g \mapsto \sigma_g \]
\[\sigma_g(ph) = pgh\]
where \(\mathrm{Aut}_G(P_y)\) is the group of \(G\)-equivariant automorphisms of \(P_y\). Essentially giving a point in \(P_y\) identifies \(P_y\) (non-canonically) with \(G\), thus we can multiply on the left and obtain \(G\)-equivariant (which acts on the right) automorphisms.
A gauge transformation of \(P\) is a \(G\)-equivariant map \(F:P\to P\) such that \(\pi\circ F = \pi\). Think of it as a ‘deck transformation’ but is compatible with \(G\)-action. This means gauge transformations are fibre-wise automorphisms of the principal bundle, i.e. \(F_y \in \mathrm{Aut}_G(P_y)\) for all \(y\in Y\). If you identify it non-canonically with \(G\), on each fibre they are (can be different for each fibre) multiplications on the left.
The vertical bundle \(T(P/Y)\) is the kernel of \(\mathrm{d}\pi:TP\to TY\), i.e. tangent vectors that only move in the vertical direction.
\[ 0\to T(P/Y)\to TP\to TY\times_Y P \to 0\]
A connection is then, taking a tangent direction on the base \(Y\), and a point in \(P\) above that vector, giving you a tangent vector in \(TP\) (which is the local horizontal movement)
\[ \nabla: TY\times_Y P \to TP \]
whose image \(\nabla(v,p)\) is denoted by \(\nabla_{v,p}\in T_pP\).
The image \(\nabla(TY\times_Y P)\subset TP\) is the distribution of vector fields of rank \(\dim Y\) on \(P\), also called the \(\nabla\)-horizontal distribution \(\mathcal{H}_\nabla\). You can think of it as the sub-manifold of vectors that are horizontal.
Clearly the tangent bundle decomposes into horizontal and vertical components
\[TP = \mathcal{H}_\nabla \oplus T(P/Y).\]
As we have seen, a connection gives a horizontal lift operator
\[\nabla: \mathfrak{X}_Y \to \pi_*\mathfrak{X}_P : v\mapsto \nabla_v\]
where \(v\) and \(\nabla_v\) are vector fields, given by \(\nabla_v(p) = \nabla_{v_{\pi(p)},p}\). Locally it lifts a vector field on \(U\subset Y\) to a vector field on \(\pi^{-1}(U)\subset P\).
We say a connection \(\nabla\) is principal if it is \(G\)-equivariant:
\[\nabla_{v,pg} = \mathrm{d}R_g(\nabla_{v,p})\]
which is equivalent to
requiring that the distribution \(\mathcal{H}_\nabla\) is \(G\)-invariant
or, equivalently, that the horizontal lift consists of \(G\)-invariant vector fields.
We say a connection \(\nabla\) is flat if it is a Lie algebra homomorphism \(\mathfrak{X}_Y \to \pi_*\mathfrak{X}_P\):
\[[\nabla_v,\nabla_w] = \nabla_{[v,w]}\]
Let \(\mathcal{V}\) be a vector bundle of rank \(n\), consider the frame bundle
\[P_\mathcal{V}(U) := \mathrm{Isom}(\mathcal{O}_U^n,\mathcal{V}|_U)\]
This is a \(\mathrm{GL}_n\)-principal bundle over \(U\). Suppose \(P_\mathcal{V}\) is the frame bundle associated to a bundle with connection \((\mathcal{V},\nabla)\), a natural question to ask is, can we find a natural connection on \(P_\mathcal{V}\) (likely a principal connection)?
Write \(\mathcal{V}\) in terms of trivialization and gluing data, in terms of Cech cocycles \((U_\alpha,\psi_{\alpha\beta})\in Z^1(\mathcal{U},\mathrm{GL}_n(\mathcal{O}))\) where \(\psi_{\alpha\beta}\in \mathrm{GL}_n(\mathcal{O}(U_{\alpha\beta}))\).