  We give an introduction to phase transitions in the steady states of systems
that evolve stochastically with equilibrium and nonequilibrium dynamics, the
latter defined as those that do not possess a time-reversal symmetry. We try as
much as possible to discuss both cases within the same conceptual framework,
focussing on dynamically attractive `peaks' in state space. A quantitative
characterisation of these peaks leads to expressions for the partition function
and free energy that extend from equilibrium steady states to their
nonequilibrium counterparts. We show that for certain classes of nonequilibrium
systems that have been exactly solved, these expressions provide precise
predictions of their macroscopic phase behaviour.
