In one org, I have used Case.SourceID (queried SELECT Parent.SourceId FROM EmailMessage), which would tell me the ID of the EmailMessage that was the original case origin email.
In another org, the Case.SourceID field does not even exist. How is that possible? Some kind of email-to-case configuration that needs to be turned on?
Strangely, the documentation describes this field as containing the "The ID of the social post source".
Alternatively, is there any other method by which to determine which EmailMessage originally created a case? It seems overkill to have to query every single existing email message and compare their created dates.