div tag is used to create section in webpage like if you want to create footer section put all the elements required in header into that div element same for footer and other sections. inshort it is used to divide webpage into different sections.
e.g. we use div (it means division) for creating menus of the website. So we create a div for something like left menus and it will have some nested divs for each menu. and also we can do this for header, footer, posts, and etc.