Do E-Mails have an identifier that tells what was replied to
? I don’t think there is but if there existed such a marker then you build a very nice tree structure.
And that's what mature email clients use to present thread trees, to help make sense out of email conversations. Gmail, etc., are not mature email clients.
Observe, furthermore, that References: was in part designed so that a MUA/NUA could reconstruct a tree even if some intermediate messages were missing.