It prevents the execution of codes written inside it until the DOM is ready/loaded. Thus it ensures the availability of referred elements.