Jquery resize event question

If I have a function called getWindowSize that runs after a browser resize:
$( window ).resize( (getWindowSize) );

How does it know to run after the DOM finishes loading with this code I have on the page:

and instead of just running:

Basically how does it know to run $(document).ready(getWindowSize); and not just getWindowSize(); ?