The replies here are close, but not exactly right. Zip codes largely map to individual post offices. Once mail gets to the correct post office, then it will get sorted into routes for delivery.
The reason why the distinction of post offices is important is that zip codes are not required to follow state boundaries (technically, zip codes aren't an area, but a list of delivery points). In fact, there are a lot more than you'd think that span across state lines, so there may actually be a mismatch between the state for your address and the state for the post office your mail is delivered by.