I'm not sure as I'm still a beginner, but that is my understanding:
Look at the
example for x-ray: after the first (1...Kh8) move the black king is
between the white queen and black rook.
In the
skewer example after 2.Qf8+ the white queen is
outside the black king and queen.
I admit you can get the wrong idea in the x-ray example because at first it looks like a skewer (it is a skewer in that moment). But the idea is 2.Rxb7 that it
becomes an x-ray attack: the white queen attacks/defends b7 through the white queen. Kind of an interference but with the advantage for the other side.
In short the order of the pieces in a line:
skewer or pin: white - black -black
x-ray: black - white - black
(or the colors the other way around).