So if there are various macrostates that can occur (regardless of how unlikely) what does that mean for our external parameters? How can there be different macrostates with different U, V, N?
It means that the quantities which define the macrostate of the system (in this case, $U,V,$ and $N$) are not being held fixed.
- If your system is in thermal contact with a heat bath, then $U$ is not fixed because heat can flow between the system and its environment.
- If the system can expand or contract, then $V$ can change.
- If the system is in contact with a particle reservoir (e.g. a semi-permeable membrane), then $N$ is not fixed because particles can flow in and out.
Consider a system with fixed $U,V,$ and $N$. The values of $(U,V,N)$ define a macrostate of the system. The number of microstates which correspond to this macrostate, also called the multiplicity, is $\Omega(U,V,N)$; since all microstates are equally likely, the probability that the system is in any particular microstate is simply $\frac{1}{\Omega(U,V,N)}$. The collection of all such microstates and the associated uniform probability distribution is called the microcanonical ensemble.
Now consider a system with fixed $V$ and $N$ but which is in contact with a heat bath at temperature $T$. The system can exchange energy with the heat bath, which means that its total energy is not fixed; in principle, it could have any value of $U$. The probability that a system is in a particular microstate now depends on the total energy $U$ of that microstate.
Explicitly, the probability that the system occupies a microstate with energy $U$ is given by $P(\mu) = e^{-U/kT}/Z(T)$, where
$$Z(T) = \sum_{\text{Microstates}}e^{-U_i/kT}$$ is called the partition function of the system. This set of possible microstates (along with this probability distribution) is called the canonical ensemble.