Glass films created by vapor-depositing molecules onto a substrate can exhibit properties similar to those of ordinary glasses aged for thousands of years. It is believed that enhanced surface mobility is the mechanism that allows vapor deposition to create such exceptional glasses, but it is unclear how this effect is related to the final state of the film. Here we use molecular dynamics simulations to model vapor deposition and an efficient Monte Carlo algorithm to determine the deposition rate needed to create ultrastable glassy films. We obtain a scaling relation that quantitatively captures the efficiency gain of vapor deposition over bulk annealing, and demonstrates that surface relaxation plays the same role in the formation of vapor-deposited glasses as bulk relaxation does in ordinary glass formation.