This word entered the English language through Middle French in the 14th century, where it was used to describe a thick, sweet liquid.
It's interesting to note how the meaning of "šarāb" evolved. While it originally referred to a general drink, it eventually came to specifically denote sugar-based liquids, which are what we typically think of when we hear "syrup" today.