Then why did Jack Ruby kill Oswald? Answer: he was working for Carlos Marcello. The mafia is not just one mafia but a number of them working together for a common goal.
The mafias had a motive and if you don't think they are powerful enough to have done it, then you don't know much about them.
Frank