When a browser loads a web page and requests a static view file such as a JavaScript, CSS, image file, or another page asset, the Magento application processes the requested file before it returns the file to the browser.
This processing can include searching for a not-found file in additional locations, file merging, and file minification.
The static view files deployment command enables you to write static files to the Magento file system when the Magento software is set for production mode.
The term static view file refers to the following:
“Static” means it can be cached for a site (that is, the file is not
dynamically generated). Examples include images and CSS generated from
LESS.
“View” refers to presentation layer (from MVC). Static view files are
located in the /pub/static directory, and
some are cached in the /var/view_preprocessed directory as well.
Static view files deployment is affected by Magento modes as follows:
The default and developer mode: Magento generates them on demand, but the rest are cached in a file for speed of access.
The production mode: Static files are not generated or cached.
You must write static view files to the Magento file system manually using the command discussed in this topic; after that, you can restrict permissions to limit your vulnerabilities and to prevent accidental or malicious overwriting of files.

Developer mode only: When you install or enable a new module, it might
load new JavaScript, CSS, layouts, and so on. To avoid issues with
static files, you must clean the old files to make sure you get all
the changes for the new module.
Source: Magento