We don’t. It’ll work the same with or without curly braces. I’d personally prefer to keep braces because it makes code more readable.
It’s a “best practice” to clean up after yourself - when you create event listeners, timers etc. you should remove them when you unmount the component or you may encounter memory leaks.
Nothing React specific here - this is how you’d add a global event listener in a regular javascript.
componentWillUnmount is a life cycle method (life of the react Component). Is called only on certain circumstances.
When is called in your case is executing the method .removeEventListener of the document object.
When an HTML document is loaded into a web browser, it becomes a document object .
The document object is the root node of the HTML document.