In order to give at least a partial answer to my own question, I did some (non-exhaustive) testing with the following setting:
Accounts
I use two iCloud accounts. A "private" one that is also the default account of the Contacts app. And a "shared" one.
Addresses
I use a "test" email address, which I associated with four different entries in my Contacts app.
One entry in the private account, which I also marked as "my card".
The test address is one out of several email addresses.
Another entry in the private account.
The test address is one out of several email addresses.
An entry in the shared account.
The test address is the only address of this entry.
An entry in the shared account.
The test address is one out of several email addresses.
In order to easily recognise the effects in Apple Mail panes (message list and message preview), I use different names (prefix, first, last) for the three entries.
Apps
I assume that both the Contacts and the Mail app make heavy use of caching. I tried to prevent misinterpretations due to caching effects by closing and reopening these apps after changes to the entries. (Some entry changes nevertheless seem to take almost immediate effect to long names that are displayed in Apple Mail, but that is maybe worth another story.) I also deleted the Previous Recipients List.
Experiment
I send from the test address (webmailer) in "To" at entry 1 (but not the test address), 2 (but not the test address), and 3, and with "Cc" to the same addresses.
I mainly wanted to find out:
- Which of the four entries in Contacts is chosen for displaying the long name in the "From" field in the various panes of Apple Mail?
- Are there differences between the long names displayed in the "From", "To", and "Cc" (fields).
I observe the following behaviour on the Mail apps of both(!) macOS and iOS devices:
The message list pane will (almost) always display the long name of entry 1 as the From address, while the message preview pane will always display the long name of entry 3 as the From address.
In the "To" and "Cc" lines, the message preview pane will always display the long name of entry 1 for 1, 2 for 2, and 3 for 3. This was expected.
The behaviour seems independent of the order of occurrence of the test address in the entries 1 and 2. (3 has it as its only address, so there is no variety on any order.)
Redoing the above experiment by adding in entry 4 (but not the test address) in "To" and Cc"", this was displayed with the long name of entry 3. This was not expected.
Conclusion
Mail obviously uses different strategies to decide which name to display in the "From" field of message list and message preview.
More testing is required to reengineer the decision strategies for displayed long names, also concerning the "To" and "Cc" fields.