I have seen many jet engines rotate different directions while they look on same shaft.

I want to understand how they look rotating in different rotation? something I don't get
it
below picture that explains my point more. is there gearbox that changes direction? or they use two shafts?

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/i8CtN2j8.png