Okay, I've had to think about this a lot!
So in English, sentences take the form SUBJECT, VERB, OBJECT, right? SVO. Gaelic sentences, on the other hand, take the form VERB, SUBJECT, OBJECT (VSO).
In the English sentence 'Elizabeth has a friend', it very clearly follows the normal SVO pattern. Elizabeth is the subject, has is the verb, and a friend is the object.
Now here's where it gets a bit complicated.
The subject in the Gaelic sentence here is actually the caraid, and not Ealasaid. The subject of the sentence is the one which is doing, and the object is the one who is being acted upon by the subject. Here, the caraid is the subject because they are the one doing. They are existing as Ealasaid's friend. They are aig Ealasaid. Ealasaid is only there to receive them. Therefore she is the object.
If I had to literally translate that sentence, I could put it as something like: 'A friend is at Elizabeth.' It doesn't really read properly in English, but you get the gist. The friend, in that sentence, would be the subject, and Elizabeth the object.
I hope that makes sense! (And I hope I've got that right!)