Of course it predates history (though cannabis being eaten likely predates throwing the stuff on the fire by quite a long way). But it doesn't pre-date the migration of humans from Africa to Not-Africa.
Alcohol is caused by honey or berries being discovered later than fresh - which predates the existence of Homo Sapiens (and thus, locked into the African continent).
We're talking about the difference between "probably the last 8-10 thousand years" versus "probably the last few million years".
Not just great apes, but monkeys and other animals get drunk in the wild. None eat things that aren't growing where they live.
IF I'm right about the origin of cannabis and amanita(?) 'shrooms.
And I'm not trying to satisfy you that the length of pre-historical use is WHY alcohol "was legalised"; I'm making a suggestion that it's longevity and ubiquity mean that it's only ever been "illegalised" in relatively small locations in geography and history. And it's much more the ubiquity - the rest is more something that interests me, and me realising I haven't communicated my meaning well enough.
Alcohol is (close to) ubiquitous with humanity as for long periods of time, it was the only safe way on consuming fluids. That's never been the case with cannabis, opium, or any of the other ancient drugs.
It's one thing to ban something that has obvious harms and is only used by a relatively small percentage of society (opium), a relatively small percentage of society who are the "other" to those in power (cannabis); or a larger percentage, but still minority when backed with decades of evidence of harm to both the user and non-user and decades of evidence of societal expenditure mopping up after it (tobacco) than it is to ban something used by the (vast) majority, including your political supporters when the evidence of harm is less scary (sorry, the word "cancer" is more scary than the word "cirrhosis"), evidence of harm to others is indirect rather than direct (it's the drunk person, not the alcohol that causes the harm), and the decades of societal expenditure mopping up afterwards simply costs less (typically property damage and relatively short-term injuries rather than decades worth of care for each individual).
None of which means that alcohol is safer than tobacco, or that one should be banned and the other allowed. It's an attempt to provide A POTENTIAL / PARTIAL answer (or at least, adding some nuance) to the question of "why the one drug we make legal is one of the most, if not the most, harmful drug in the world"