Historically, people have drunk surprising amounts of alcohol – we may not have been as collectively sober as today for millennia (depending on the exact location, to be sure); beer and wine have the big advantage that they're reasonably safe to drink even if the primary source of water isn't (due to the fermentation process and the alcohol content), and that it's easier to tell when they aren't (because if fermentation doesn't work right, you definitely notice). In some of the more remote areas in the alps, even children still drank lots of diluted wine as late as the 1950s, for precisely that reason. That sort of thing was the rule, not the exception, for Europe pre-industrialization.
Evolutionary pressure on humans also doesn't usually involve everyone with allele X dropping dead right away, because people are pretty creative at avoiding that outcome, and it's often (probably, likely) not about small-ish effects under good, stable conditions, but outsize ones in exceptional circumstances.
There have been bad years and very bad years all the time; even as late as the 19th century, agrarian societies were pretty much helpless if harvests failed on a large scale (think Irish Potato Famine), and that's after 6000-ish years of working on that existential problem. When bad years become bad decades, and lots and lots of people die, that's when things like alcohol tolerance and lactose tolerance can make a big difference.
Being able to tolerate alcohol may mean access to a cleaner source of fluid, less pathogens for weakened immune systems to deal with, and access to nutrients that store pretty well. There may have been a social component as well – getting drunk together has been an extremely important vehicle for networking and bonding for literal ages. Finally, being able to get drunk relatively safely may have kept people functioning through highly traumatic experiences as well. Not saying that's what happened for sure, but a few ways this could have played a decisive role.