sw.js is simply the name most tutorials give the service worker file, including MDN's examples. Any file name works. What matters is where the file lives, because a service worker controls only the URLs in its own folder by default. A worker at /js/sw.js controls pages under /js/ and nothing else, which is why most sites serve it from the root. You can set a narrower scope when you call navigator.serviceWorker.register, and a wider one needs the Service-Worker-Allowed response header.
Browsers check for a new version of the file on their own. A check happens when the user navigates to a page in the worker's scope, and on events such as push and sync unless a check already ran in the previous 24 hours. If the downloaded file differs by even one byte, the browser installs it as an update. Most browsers, including Chrome 68 and later, ignore HTTP caching headers when they check the worker file, and the updateViaCache option of register changes that. See HTTP caching for how the other files are cached.
The W3C specification defines a service worker as a worker that wakes to receive events. MDN lists three kinds of worker on the web: dedicated workers, used by a single script; shared workers, used by several windows or iframes on one domain; and service workers, which sit as a proxy between the web app, the browser, and the network. Only service workers can intercept requests and keep a site working offline.
In system design interviews, a worker usually means a server-side process instead. It pulls jobs from a message queue and runs them in the background, like the workers in a distributed job scheduler. The worker process page explains server workers, and workers vs threads, in full. Both run apart from the code that answers the user directly, but one lives in the browser and the other on your servers. The Progressive Web Apps lesson shows how service workers make a site installable.