"Vis-à-vis"

The literal translation of this French phrase is “face-to-face.”

Can anyone explain the history or logic of its also being used to mean “in relation to” and “as compared with”?

This strikes me as really three different meanings.

I’m not sure it really has that different a meaning - if you examine something in relation to/compared with something else, you are looking at it’s “face” compared to another one (where “face” is really any quality of interest). We often use “side-by-side” in this context, but it’s kind of the same thing, IMHO.

In French, vis-à-vis used in the same way as in all three of your translations, though I think I mostly hear it to mean " in relation to/compared with".

The phrase orginally entered English as the name for a light carriage which carried two people who sat facing each other. From there it progressed to a noun referring to either of two persons or things situated opposite one another - either literally or (more usually) metaphorically. This could imply some degree of opposition, or at least constrast. Thus it might be said that Washington DC was the political capital of the US, but New York City was its cultural or commercial vis-a-vis. A “counterpart” would probably be the closest modern term. And somewhere along the way it became a preposition meaning face-to-face with, facing, contrasting, opposing, over against.