The main advantage of messages and events is, that the emitter does not (need to) know what is called. For example, if you have a button in your HTML and someone clicks it, your browser has no way to call a function in your JS (because that's your code), so it sends an onclick event. You can then write some JS, which listens for that event and acts upon it.
<!--
-- The browser knows that there is a button.
-- However it does not know what to call when it is clicked.
-- So it just sends out an event, to whoever it may concern.
-- That might be noone, or a thousand handler functions.
-- Your browser, though, does not care and just does its thing.
-->
<button id="sample-btn">Hello!</button>
const buttonClickHandler = _ => console.log('Hello');
// In JS, you can add a listener,
// which is called whenever the event is fired.
document
.querySelector('#sample-btn')
.addEventListener('click', buttonClickHandler)
;
// You can even remove the listener
// once you are not interested in the event anymore!
document
.querySelector('#sample-btn')
.removeEventListener('click', buttonClickHandler)
;