We show how the zeroth, first, and second laws of black hole thermodynamics emerge from a generic semiclassical theory of gravity. The zeroth law is a kinematic property of bifurcate Killing horizons. It depends neither on details of the semiclassical coupling nor on the dynamics of gravity. The first law is established for stationary spacetimes for which a Hamiltonian can be defined. The second law is established in "piecewise stationary" spacetimes, roughly speaking a stationary spacetime that is disturbed and eventually returns to a different stationary sate. Black hole entropy is consistently defined in the Noether charge approach, and the entropy for the matter in its exterior is the von Neumann entropy of the quantum fields. These results elucidate the meaning of these laws and strongly support the interpretation of black hole entropy as an account of the information that is hidden behind the horizon.