  With the help of a masslike function which has dimension of energy and equals
to the Misner-Sharp mass at the apparent horizon, we show that the first law of
thermodynamics of the apparent horizon $dE=T_AdS_A$ can be derived from the
Friedmann equation in various theories of gravity, including the Einstein,
Lovelock, nonlinear, and scalar-tensor theories. This result strongly suggests
that the relationship between the first law of thermodynamics of the apparent
horizon and the Friedmann equation is not just a simple coincidence, but rather
a more profound physical connection.
