It's because the function is calling itself. It may be simpler to think about this as not one file that is looping, but rather as a new version of the "fact" function getting opened each time it is called. I hope that makes sense.
+Sam Shamon Thank you for your feedback. I have to point out, though, that I went through execution of the function starting at 5:17. Additionally, I have a separate video on MATLAB functions, since there is too much to say about them if I were to combine them with another topic, especially one as complicated as recursion. As far as a simpler example, I apologize if this was not to your liking. In my opinion, the factorial is a simple example, in that it requires only one line of code for computation. If you have a better suggestion, please post it here, as it would no doubt be beneficial to others.