General coding question about Events and functions

My classes are currently working in Unit 6 and using the circuit playground and I have a couple questions.
First, I have noticed that some of my students are writing functions and then putting the onBoardEvent handler or the onEventHandler inside the function. I have told them over and over not to do this, but some of them still do. What I don’t understand is how the event handlers are still getting called when they are inside of a function. Sometimes the function itself doesn’t eve get called. I would think that if an event handler is inside a function, it would only get called if the event happened in the small window of time that the function was being processed. Can someone explain to me how/why it works when the event handler is inside the function?

Second question, in the onEvent and onBoardEvent handlers, the third parameter is a callback function. Why does put the word “event” as a parameter for this callback function and then gives a warning that " ‘event’ is defined, but not called in your program."? This confuses my students because I make them fix any warnings or errors, but this one I tell them to just leave. I put both the text version and (I tried) to insert a snapshot of the blocks version.
onEvent(“move”, “click”, function(event) { }