...What about water?
The problem with water is that it gets infected with microbes and goes bad, all slimy. If you seal it in glass or ceramic decanters it goes bad anaerobically. Keeping it in skins or wooden casks increases the amount of nutrients microbes can metabolize.
Drinks tended to be alcoholic because the alcohol tends to kill and thus check the infections; various kinds of booze can still go bad, especially if the alcohol content is modest, but beer or wine would keep a lot better than clean water. Bear in mind that "fresh" water that has not been boiled or chemically treated is already infected from the get-go, the moment you scoop it out of a flowing stream or well.
Being made from dates, grapes or other sweet fruits, nabidh might start out without significant fermentation but apparently the drink is pretty much defined as being prepared just when the fermentation is starting. Freshly made nabidh would have no alcohol to speak of but after it has been stored a while it will build up a kick; presumably the microorganisms that do the fermenting are relatively harmless and have largely preempted other infections, and gradually as the alcohol builds it gets harder and harder for bad infections to take place. The catch-22 is that of course this is because it is turning into actual booze!
As others have pointed out, all the Islamic prohibitions and commandments are relative; they are meant to be rational and give way to necessity. One can eat forbidden foods if hosts with good intentions serve it to you as a guest for instance--it would be rude to turn down their hospitality. A Muslim is enjoined not to make up unnecessary occasions to break the rules of course, but if true necessity exists, any rule can be waived. If in fact then seamen laid in supplies of fresh nabidh that didn't get them drunk and it gradually got stronger, then Allah's will be done--unless of course the crew darn well knows an alternative exists.
I was wondering whether some alternatives, such as tea or coffee, might in fact have sufficient antiseptic properties to become such an alternative. Certainly in order to make either, one has to boil the water first, or anyway heat it up quite a lot. If one has casks of water that have gone bad, boiling water taken from them and then drinking it once it cooled a bit would probably eliminate the infectious microbes, but I suppose the stuff would still taste terrible. And there might be some toxins left. Anyway freshly made coffee or tea would surely take care of the problems (insofar as the boiled water was itself any good). If possible it would be better to just drink the boiled water, since caffeine is itself a sort of intoxicant (but never prohibited, though I gather there was some debate about that for some generations). It is also a diuretic so if the point is to keep adequately hydrated it is a bit counterproductive!
For the past half decade or so I've had the terrible habit of making a pot of coffee once every several days, and on subsequent mornings just drinking yesterday's or the day before's cold coffee until it is gone, and I have to make another pot.
Well, this obviously dubious practice of mine hasn't killed me yet, so I have to wonder whether a pot of strong coffee does indeed resist infection in itself, or if I'm just stupid lucky. Or sicker than I realize.
Anyway, I gather coffee was not largely known among Arabs until relatively recently, just the past 700 years or so, whereas of course the Muslim era was half elapsed by then, so it would have been exotic and not generally available to them in the classic centuries of the early Caliphates (and still less in pre-Islamic days of course). They might have known about tea for longer, but of course it would be an expensive, rare exotic import from a country that was a byword for being distant, at the far end of the known world. One they did trade with, but not on terms where they could get massive shiploads of the stuff on advantageous terms the way the British East India Company learned to do (by trading in opium, ultimately
). Anyway I don't know that tea keeps even as well as coffee does (as a brew I mean).
I also wonder whether the scientifically minded early Muslims ever experimented with simply boiling water--keep it in glass or ceramic jars to minimize infusion of biochemicals, and periodically pour the supply into a kettle, boil it, let it cool, and pour back into the bottles which would have any slime scoured away and rinsed. This would deplete a given supply faster than simply leaving it alone, both from rinsing and from evaporation, but if the outcome is healthful water to drink on long voyages (or over land desert expeditions) that is surely worth knowing about anyway. Fire on ships is something to keep a close watch on, and fuel might be hard to come by in the desert, but I do wonder if anyone ever stumbled on the practice of boiling water to purify it.
Another trick might be to have drinks stored in alcoholic form, so they keep, but then distill the alcohol out, again by gentle boiling, to drink the residue with lower alcohol content.
I have no reason to think the Arabs traditionally ever did any of these things, but I do wonder about experiments along these lines and if so, were they abandoned because they proved impractical.