I have done a number of test on this and not been able to determine what causes Canvas to record that a student has left the page.
From my findings, Canvas will often NOT record instances of students leaving the page. If they go to another tab, open another window or word doc, minimize the quiz, or copy and paste text from other documents. Some of these instances got flagged as "leaving the quiz" but not all of them, and not consistently. For the most part, the only consistent way to get the quiz log to show that I had left the quiz, was to click on the Home, or dashboard button, then navigate back and "Resume" the quiz attempt.
All of the Canvas documentation emphasizes that the Quiz Activity Log is not meant to be used to detect cheating. There are no settings in Canvas to tell the system that a student opening a word document, is cheating, or is accessing a professor approved resource for a question. Canvas has a very open philosophy of teaching, and as such, the quiz allows for teachers to have open book quizzes, internet scavenger hunt quizzes, as well as structured and regulated quizzes.
In the attached picture, I often had results come up where students would appear to have left the quiz, continued to answer questions, and then resumed. Yet, when doing that attempt, I did not leave the quiz, rather I attempted to insert a document into the Essay question using the RCE. there were also other instances where Canvas would record me Leaving the quiz, and resuming the quiz in the same second. I can only assume that the above two instances were glitches, and I was unable to determine what had caused those or how to replicate them.
Note: all of my experiments were done using basic Canvas, with no feature upgrades, and Classic Quizzes.