> How do replies work
Reply references the post it is replying to by ID, most boards will turn that ID into a link or even create a UI to view a chain of replies.
> How do you know it's actually the person you're replying to who's replying back?
You shouldn't, an anonymous imageboard invites you to engage with ideas, not people. However, on most boards you can enter a password with your post, which is displayed as a hash, changing you from anonymous to pseudonymous (although this is generally considered attention-seeking and is frowned upon).
Thank you for explaining it.