The natural emergence of the correlation between H2 and star formation rate surface densities in galaxy simulations