This file must have the plugin logic, that registers and handles custom elements, payment gateways, overrides UI functionality.
Plugin logic is loaded and executed always, even if that plugin is disabled. Disabling plugin only tells builder to ignore custom elements and payment gateways registered by the plugin.
Note.
Since v3.7.301 plugin logic is loaded from main.min.js instead of main.js if minified version is present and builder is not in admin (template creation) mode.