A first-principles derivation of York scaling and the Lichnerowicz-York equation