It does a bit more than just add that.
It replaces this structure:
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="{some_link}">
{some_page_name}
<b class="caret"></b>
</a>
with
<a class="a-stripped" href="{some_link}">
{some_page_name}
</a>
<a href="#" class="dropdown-toggle a-caret" data-toggle="dropdown" data-target="#">
<b class="caret"></b>
</a>
I basically move data-target and data-toggle from the existing link to a new one that I wrap around the caret. This way the initial anchor regains its link and no longer opens a submenu. The opening of the submenu is done now by the new link, the caret wrapper.
I’m using the same logic as tweeter Bootstrap 3. The guys at tB realized that disabling parent links in menus was a mistake, that was holding people off from using their menus and they have corrected this in Bootstrap 3, by dividing the parent buttons in two areas: link (the text) and caret (the arrow). It’s exactly what I do here. I create an extra link for the caret, so the initial one works as the WordPress menu intended it: a link to a parent page.