  In this article we completely describe the existence of canonical metrics,
known as optimal symplectic connections, on isotrivial K\"ahler fibrations. In
this setting an optimal symplectic connection is induced from a
Hermite--Einstein connection on the holomorphic principal bundle of relative
automorphisms, and the Hitchin--Kobayashi correspondence asserts the existence
of such a connection precisely when the principal bundle is polystable.
Combined with results of Dervan and Sektnan this generates many new examples of
cscK metrics on the total space of holomorphic fibre bundles. Our results
indicate that in general the optimal symplectic connection equation should be
viewed as a generalisation of the Hermite--Einstein equation to holomorphic
fibrations where the complex structure of the fibres varies.
