This is a very naive question. As far as I understand the folding of a molecule is governed by the electromagnetic forces between its atoms and also between its atoms and the atoms in the surrounding environment (so basically a many body problem). So I don't understand how statistical mechanics, such as Boltzmann's law, come to play.
To my knowledge statistical mechanics and thermodynamics exist when we have an ensemble of particle such as in a liquid or a gas. So what is this ensemble for the RNA or protein folding problem?