Because TypeScript is structurally typed, a UserId and an OrderId that are both string are interchangeable — the compiler can't stop you from mixing them up. Branded types simulate nominal typing by attaching a unique, phantom "brand" so otherwise-identical types become distinct.
