About two notions of holonomy I have found something called "holonomy" in two apparently different contexts:


*

*Let $M$ be a smooth manifold, $E\to M$ a vector bundle and $\nabla $ a connection on $E$. Then you have a notion of parallel transport, and thus a notion of holonomy as introduced here.

*Let $M$ be a smooth manifold with a $(G,X)$-structure, i.e. an atlas made of charts with values in $X$ and transition maps from $G$. This gives a representation $\rho : \pi_1(M) \to G$, which is called the holonomy of the structure.


The first holonomy does not obviously give a representation of the fundamental group: for example it is not invariant under homotopy of the paths. My question is: are these two notions somehow related (at least in some well-behaved case), or it just happens that we use the same name and we'd better call the second one "monodromy".
 A: Connections and parallel transport generalize from vector bundles to principal $G$-bundles for any Lie group $G$, which specializes to the case of vector bundles when $G = \text{GL}_n$. In particular, if a principal $G$-bundle is equipped with a connection then you get a notion of parallel transport / holonomy sending any smooth loop in a smooth manifold $M$ to an element of $G$. If the connection is in addition flat, then parallel transport is homotopy invariant and you get a monodromy map $\pi_1(M) \to G$. 
So the relationship is that a $(G, X)$-structure on a manifold furnishes it with a principal $G$-bundle together with a flat connection. The principal $G$-bundle can be described using the transition maps of the structure and I'm a little more confused about where the flat connection comes from, but it should be there somewhere. 
A: Let's start with definitions: An $(X,G)$-structure on a (connected) manifold $M$ is an atlas with values in $X$ and transition maps in the group $G$. Hence, for every two overlapping charts $U_i\cap U_j\ne \emptyset$, we get an element $g_{ij}\in G$. One verifies that the map $(U_i, U_j)\mapsto g_{ij}$ satisfies the cocycle condition
$$
g_{ij} g_{jk} g_{ki}=1\in G
$$
whenever the triple intersection is nonempty: $U_i\cap U_j\cap U_k\ne \emptyset$. 
On the other hand, defining a bundle $E\to M$ with structure group $G$ amounts to prescribing a (continuous) cocycle
$$
\xi_{ij}: U_i\cap U_j\to G.
$$ 
(The cocycle equation is exactly the same as above.) The map $\xi_{ij}$ sends $z\in U_i\cap U_j$ to some $g_{ij}(z)\in G$ depending continuously on $z$. 
Saying that this bundle is flat amounts to saying that the cocycle is continuous even if we consider the structure group $G^\delta$, the group $G$ equipped with discrete topology. In other words, the map $\xi_{ij}$ is locally constant in this case. By choosing a suitable refinement of the coordinate cover, we can assume that the cocycle $\xi$ is constant on $U_i\cap U_j$ and, hence, (for each $i, j$) is determined by a single element $g_{ij}\in G$.  
Now, it is a basic fact that every "constant" (on intersections) cocycle $\xi$ defines a representation $\rho: \pi_1(M)\to G$, called the monodromy representation of the corresponding flat bundle $E\to M$. This is explained for instance in Steenrod's (classical) book "Topology of fiber bundles". (If I remember it correctly, Steenrod calls this representation a "characteristic class" of the flat bundle.) 
Steenrod considers bundles with arbitrary base and fiber (they are only required to be topological spaces). Suppose, however, that $E\to M$ is a vector bundle with the structure group $G$ acting linearly on fiber $V$. Then every flat connectio $\nabla$ on $E$ defines a natural local trivialization of $E$ with respect to which the connection is trivial. Equivalently, the horizontal foliation of the connection is the constant foliation on $U_i\times V$, $U_i\subset M$, with leaves of the form
$$
U_i\times v, v\in V. 
$$
Then the corresponding cocycle $\xi_{ij}$ is locally constant. Lastly, one checks that Steenrod's construction of monodoromy in this setting amounts to the same thing as the "parallel transport along fibers" that you see in holonomy of (flat) connection. 
One further compares Steenrod's construction with the one which assigns monodromy representation to an $(X,G)$-structure and realizes that the latter depends only on the cocycle $\xi$ and is identical to the one defined by Steenrod. 
In other words, all three monodromies (Steenrod's, the one given by the flat connection and the one given by an $(X,G)$-structure) are the same, once one forgets the $(X,G)$-structure (and flat connection) and remembers only the locally constant cocycle. 
Of course, an $(X,G)$-structure is much more than just the cocycle, but that's another story. (Such structure amounts to choosing a flat $X$-bundle over $M$ with the structure group $G$, together with a section of this bundle which is transverse to the leaves of the horizontal foliation defined by the flat connection.)  
