The Latin sounds for “sh” — and similar variations, like “ch” and “ss” — became a “j” sound in Spanish.
Thus, the English sherry is nearly identical to the Spanish jerez!
These sh/j sounds were often spelled with a “x” in old Spanish; and sherry itself is named after the town it first came from, Xeres, which is near Cordova.