The following is taken nearly verbatim from section 1.1.2.1 Free Energy Computations: A Mathematical Perspective by Mathias Rousset, Gabriel Stoltz and Tony Lelievre. An excerpt, in which the part I am quoting from is contained, can be viewed for free here.
Consider microscopic systems composed of $N$ particles described by positions $q := (q_k)_{k = 1}^{N} \in D$ ($D$ is the configuration space) and momenta $p := (p_k)_{k = 1}^{N} \in \mathbb{R}^{3 N}$. The vector $(q, p)$ is the microscopic state or the configuration of the system. [...]
In the framework of statistical physics, macroscopic quantities of interest are written as averages over thermodynamic ensembles, which are probability measures on all the admissible microscopic configurations: $$ \mathbb{E}_{\mu}(A) := \int_{T^* D} A(q, p) \mu(dq \; dp). $$ In this expression, $A$ is an observable. [...] As $p \in \mathbb{R}^{3 N}$, the cotangent space $T^* D$ from above can be identified with $D \times \mathbb R^{3 N}$.
My question. Why does the notion of a cotangent space come into play here? If $q \in D$ and $p \in \mathbb{R}^{3 N}$, why isn't the set that is integrated over simply $D \times \mathbb{R}^{3 N}$, but a priori the cotangent space of $D$?