How does Messages work between my Mac and my iPhone? I thought with Mountain Lion that Messages are shown on both my Mac and iPhone (so I can start a chat on my iPhone and continue it on my Mac).

What is weird is that I seem to get an arbitrary set of messages on my Mac but it's definitely not fully in sync with the iPhone. A number of iPhone messages never show up on the Mac at all, or 1/2 of the conversation shows up.

Do I need to set something up specifically to make this work or is this as expected?
I think the source of your confusion is the difference between traditional text messages (SMS) and iMessages (Apple's own protocol).

Messages on the Mac doesn't support SMS. Any message you send or receive on your iPhone as SMS won't show up in Messages on the Mac.

If you send a message as an iMessage, though, then it'll show up on the Mac. Now here's where it gets confusing: even though iMessages are "data" and not "text," they can be sent between phone numbers. If you've got iPhones at both ends, a "text" sent from one to the other will be sent as an iMessage by default. These messages will then appear in Messages on the Mac.