gtag.js aka Global Site Tag is a tracking snippet for Google Analytics. Its predecessors are still widely used analytics.js and ga.js.
Currently, gtag.js is the default snippet suggested by Google Analytics.
Here’s what Google says about gtag.js
The Global Site Tag (gtag.js) provides a framework for streamlined web page tagging – giving you better control while making implementation easier. Using gtag.js lets you benefit from the latest tracking features and integrations as they become available.