Leonardo credited this invention to Archimedes.
During Leonardo's time, bombards were becoming widely used. It is possible that Leonardo, in his search for new solutions, was attempting to find an alternative to gunpowder. Knowing the power unleashed by the steam expansion in a piston he decided to use its energy to achieve a strong explosion.