Ultimately, it was just a gag.
That much is obvious. In this situation, it was mainly just a way to break up the action, Thor demanding that he gets the bigger weapon.
That said, the origins of Mjolnir, and Stormbreaker, explain that they work in similar ways:
Mjolnir itself has several enchantments: […] it returns to the exact spot from which it is thrown and returns to its Thor when summoned
Source
Beta Ray Bill's weapon, Stormbreaker, also has the same properties as Thor's hammer, Mjolnir
Source
That said, Beta Ray Bill obviously does not (directly) exist in the Marvel Cinematic Universe, so Stormbreaker is not a link to him in any way. The process of creating Stormbreaker in Infinity War was simply a way to replace Mjolnir.
"I'm gonna hold it open."
"That's suicide."
"So is facing Thanos without that axe."
Over the years, "summoning" Mjolnir (and by extension, Stormbreaker) has become ambiguated into "Thor calls his hammer", with little more than that for explanation. There is no real explanation as to how he calls it, or what he thinks, or feels when it happens. So it's anyone's guess. My only suggestion is that it might be that both Cap and Thor call the weapons, and based on their proximity, and the angle of approach that the weapons have, it'd probably work smoother to have them arrive at the wrong person, rather than bump into each other on arrival (though that would probably be arguably just as funny).