How do they keep the orders straight at a drive through with multiple lanes?
They assume that, when the cars merge, they will arrive in the order that their orders were received. When there is uncertainty, they will just ask what you ordered. Even with multiple lanes, you typically arrive at the pickup first when you order at the intercom first.
The best way, in an ideal world with people merging correctly, would be to base to order of the food orders on the last completed order entry into the POS.
Granted, sometimes people will cut, not zipper correctly, or let someone ahead of them out of misguided politeness. So, when you get to the payment window, the cashier usually just asks about the most distinguishing part of the order.
“Bigmac and a coke, right?”
Usually this is the correct order, but once in a while it gets mixed up. Fortunately, there are only ever going to be two orders to pick from barring exceptionally stupid edge-cases (think along the lines of stuff you’d see on /r/publicfreakout).
Some restaurants such as McDonald’s, will often have their POS and security camera connected so that a picture of the car is associated with the order, or/and place screens so drive thru cashiers can watch the merge point to identify out of order cars.