In 1993 the first web browser with a GUI was released. It was called Mosaic. Due to it’s GUI it made www quite popular.
It’s lead developers then founded Netscape which released an enhanced version called Netscape Navigator. The pages were static though. They lacked interaction.
Unlike Java where you need to first compile the program and then run the generated byte code.
It is one of the core technologies of the World Wide Web (www) along with HTML and CSS. You can build interactive websites using JS. When you see some animations like page elements fading in and out or resizing then it’s more or less the work of JS.
All major web browsers have a dedicated JS engine which can execute the JS code.