  We consider three-dimensional N=2 superconformal field theories on a
three-sphere and analyze their free energy F as a function of background gauge
and supergravity fields. A crucial role is played by certain local terms in
these background fields, including several Chern-Simons terms. The presence of
these terms clarifies a number of subtle properties of F. This understanding
allows us to prove the F-maximization principle. It also explains why computing
F via localization leads to a complex answer, even though we expect it to be
real in unitary theories. We discuss several corollaries of our results and
comment on the relation to the F-theorem.
