The “sh” sound — often represented in writing as an “x” — transformed in all different ways to the “j” letter (and the accompanying mouth-clearing sound, influenced by Arabic) as late Latin turned into Spanish. See lots of examples: sherry/jerez, for example.
Here’s another: the common Spanish word, dejar, meaning, “to leave to the side” or “to put down” or to “put away” or to just “let go.”
Dejare comes from the Latin laxare, meaning, “to loosen”. From this same root, we get a few English words — which did not go through the x‑to‑j transformation Spanish did including:
- Lax – which basically means to loosen up, so it is similar conceptually!
- Laxative — this loosens up the remains of your food inside your body so you can excrete, to be euphemistic.
- Relax — this is a loosening of your muscles and body and mind as well. According to this same pattern, we also know that relax in Spanish is, relajar.
See more examples of this same pattern including lejos and leash here.