There's a whole subfield of "jack detection" (where the final amp stage attempts to determine what's plugged in) and probably a "jack assignment" panel in your driver software that can configure whether the OS thinks of it as "speakers" or "headphones".