Yes exactly, leaf is the internal name for a tab. That is because Obsidian uses a Tree Data Structure to store the layout, and the outer elements of a tree are called leaves.
Lines 5-8 defines a function, which, when called, focuses the specified tab and editor. I don't think the part of specifically focusing the editor is required in newer versions of obsidian though.