The physical laws of entropy