Cardinal Contarelli, who had died several decades earlier, had laid down very explicitly what was to be shown: the saint being murdered by a soldier sent by the wicked king, some suitable architecture, and crowds of onlookers showing appropriate emotion.
The commission (which, strictly speaking, was from his patron, Cardinal Francesco Maria Del Monte, rather than from the church itself), caused Caravaggio considerable difficulty, as he had never painted so large a canvas, nor one with so many figures.
The first version revealed by the x-rays is in the Mannerist style of the most admired artist in Rome at the time, Giuseppe Cesari, with a crowd of small figures amidst massive architecture.
The third version dropped the architecture, reduced the number of actors, and moved the action closer to the viewer; more than this, it introduced the dramatic chiaroscuro which picks out the most important elements of the subject, in much the same way a spotlight picks out the action on a stage, but centuries before spotlights were imagined, and chose to represent the moment of greatest drama, as the murderer has plunged his sword into the fallen saint.
Around the saint are persons showing varied emotions, as required by Contarelli: terror, awe, and consternation, while an angel holds out the palm of martyrdom.
One factor worth noting is that Caravaggio, unlike his Mannerist predecessors, has actually made a simple fact of early modern church architecture work in his favour: large cathedrals like Saint Peter's might be well lit, but small chapels like the Contarelli were not.
That said, the painting contains many references from Michelangelo, Raphael and others, which critic John Gash ascribes not so much to a need to find appropriate poses as to a desire for "a quality of monumental grandeur akin to that of the High Renaissance."