Flat connection with non-trivial holonomy? I cannot get it maybe this is a dumb question, but I cannot understand how a principal $G$-bundle can have non-trivial holonomy with a flat connection. Maybe I'm missing something, but doesn't Ambrose-Singer theorem say that the holonomy is generated by the curvature? So if it vanishes, wouldn't holonomy be trivial?
Furthermore, why a non-flat connection can have non-trivial holonomy on contractible paths? Doesn't the lifting depends only on homotopy? Can someone, please, show me a trivial example explaining these two facts?
 A: Look at a principal $G$-bundle with discrete or even finite group $G$. In this context, every connection is automatically flat. Those are (special) covering spaces, and holonomy will correspond to the action of the fundamental group of the base on the total space via deck transformations. The simplest example of the double cover of the circle $S^1\to S^1,z\mapsto z^2$ has non trivial holonomy.
The property that the monodromy of a path depend only on the homotopy class of paths (rel. endpoints) is equivalent to flatness of the connection. It's not a difficult result.
EDIT 1 Concerning the Ambrose-Singer theorem you quote, looking at their original paper (thm 2, page 12), they say that the Lie subalgebra $\mathfrak o$ of $\mathfrak g$ generated by the $\Omega(X,Y)$, for $X,Y$ tangent vectors at the point $b$, coincides with the Lie subalgebra $\mathfrak h$ of the holonomy group of the fiber over $b$. For a flat connection $\mathfrak o$ is by definition $0$, so $\mathfrak h=0$ and the connected component $\mathrm{Hol}(b)_0$ of the holonomy group over the point $b$ is trivial, so that the full holonomy group $\mathrm{Hol}(b)$ is discrete (rather than trivial).
EDIT 2 The connection is automatically flat because the local triviality provides us with integral submanifolds tangent to the horizontal distribution of the connection at every point of the total space. I don't know if this makes sense to you, if it doesn't you could take a look at the lecture notes https://webusers.imj-prg.fr/uploads//vincent.minerbe/Geodiff/m2dg.pdf , specifically propositions 2.5.2 and 2.5.3.
