When some user closes the browser, OpenVidu will sooner or later know that the user left the session. If you have designed your front code to explicetely and gracefully leave the session just before the window closes, then if you are lucky enough, the user will normally leave the session, immediately triggering the expected events. But the ability to run this code will depend on the browser and the way it was closed.
If the browser is unable to send the "leave" operation before closing, then OpenVidu will notify the user left after not receiving the expected ping messages (this will take aroud 10 seconds). So finally other users will receive the expected events to manage the situation (you will see that the "reason" property is different for both cases, so you can differentiate users leaving "gracefully" and users leaving with no logical reason, such a network disconnection or forcing the termination of the app).