He deduces both 1 and 2 must want a beer. Fact he can then answer yes means he also wants a beer and can confidently assert they must ALL want beer, the waiter's question.
Perhaps this varient will help clarify:
nostr:note1k7cd0f8d52lrjxshwh3fauqtpdlw5wsxdxcwmlv55kz4rqlv9vhqs4g2cu