Rails uses an asset pipeline package called sprockets. You throw everything in a special directory and it wraps it all up and packages it nicely for you. This also gives you SASS and coffee compilation by default.
Sprockets handles minification and cache invalidation for you.
If you don't mind the opinionated approach to your javascript and stylesheets, it works fine. If you just need to sprinkle in some javascript on top of your site, it's fantastic. If you intend for your app to be javascript heavy, a lot of people rip out sprockets altogether and fallback to webpack to handle asset compilation (and I believe the newer Rails version is integrating webpack to play nicer with the rest of the framework)
I can speak from personal experience that Sprockets is a PITA if you want to use npm.