In the paper Stable Bundles and Integrable Systems (1987), Hitchin shows that the cotangent bundles of moduli spaces of stable bundles can be viewed as integrable systems.
In section 4 of the paper, he constructs a mapping $$p:H^0(M;\ \text{ad}P\otimes K)\to H^0(M;\ K^d)$$ based on an invariant homogeneous polynomial $p$ of degree $d$ on a Lie algebra $\mathfrak{g}$ (which he later uses to construct hamiltonians). He justifies this construction by stating that the vector bundle $\text{ad}P$ is a bundle of Lie algebras each isomorphic to $\mathfrak{g}$.
Here, $P$ is a stable holomorphic principal $G$-bundle over a compact Riemann surface $M$ of genus $g>1$, with $G$ a semisimple complex Lie group, and $K$ is the canonical line bundle on $M$.
I do not understand how exactly we construct a mapping $H^0(M;\ \text{ad}P\otimes K)\to H^0(M;\ K^d)$, given the polynomial $p$?
All other discussions of the Hitchin system that I have seen (that came out some years after Hitchins original paper, for example here and here) employ a notion of Higgs bundles in the construction of the Hitchin system and do not directly mention the above mapping. I would therefore be very grateful for help.
Edit: Previously, I also included the following question (resolved due to comments below): I understand that each fibre of the associated bundle $\text{ad }P$ is a Lie algebra; however, I am not sure how to show that they are mutually isomorphic, and hence all isomorphic to a Lie algebra $\mathfrak{g}$. Furthermore, is $\mathfrak{g}$ in this case the Lie algebra associated to $G$ (I don't believe that it is for principle bundles and adjoint representations in general)?
It is probably helpful to consider the case of vector bundles first, where we can replace $\text{Ad}(P)$ by $\text{End}(E)$ for a given vector bundle $E\to\Sigma$. In this case, a section of $\text{End}(E)$ can be viewed as a family of matrices which is parameterised by the base $\Sigma$. Say $\varphi\in H^{1,0}(\Sigma,\text{End}(E))\cong H^0(\Sigma,\text{End}(E)\otimes K)$ (Serre duality) and represent it by a $1$-form also denoted $\varphi$. Then we can define $\varphi\mapsto\text{tr}(\wedge^d\varphi)$ where $\wedge^d\varphi:\wedge^d E\to\wedge^d(E\otimes K)$. But now, we can use the fact that $\wedge^d(E\otimes K)=\wedge^dE\otimes K^{\otimes d}$, which is true because $K$ is a line bundle (see here for instance). So locally, we have that $\wedge^d\varphi$ can be written as $\sum A_i\otimes\eta_i$ with $A_i$ an endomorphism of $\wedge^dE$, and $\eta_i$ a section of $K^{\otimes d}$. The trace map is obtained by just taking the trace of each $A_i$. So we are left with $\sum \text{tr}(A_i)\eta_i\in H^0(U,K^{\otimes d})$, and likewise globally $\text{tr}(\wedge^d\varphi)\in H^0(\Sigma,K^{\otimes d})$.
So when $\mathfrak{g}=\text{End}(V)$ for a vector space $V$, then we have $\det(\lambda-\varphi)=\lambda^r+\sum_{k=1}^r\text{tr}(\wedge^k\varphi)\lambda^{r-k}$ and so these coefficients (which are known to be $\text{Ad}$-invariant homogeneous polynomials) are a natural choice. When we look at more general principal bundles, we have to fix some $\text{Ad}$-invariant homogeneous polynomials on the Lie algebra $\mathfrak{g}$. But besides that, the idea is exactly the same and you should be able to copy the construction I outlined above in the case of principal bundles. I'll leave that for you to write down as it's probably a useful exercise to make sure you understood the concept.