The first five arahants are said to have attained that after hearing the Buddha's second sutta, which was the Anatta-lakkhana Sutta: The Discourse on the Not-self Characteristic.
MN 26 however says,
And so I was able to convince them. I would teach two monks while three went for alms, and we six lived off what the three brought back from their alms round. Then I would teach three monks while two went for alms, and we six lived off what the two brought back from their alms round. Then the group of five monks — thus exhorted, thus instructed by me — being subject themselves to birth, seeing the drawbacks of birth [etc...]
I don't know how to reconcile the timeline of that, with the Anatta-lakkhana sutta's being the second sutta.
This question is discussed on pages 43 through 44 (i.e pages 2 and 3 of the PDF file) of this document: Assaji Sutta (also known as "SD 42.8" of Piya Tan's Sutta Discovery series). The bit of that that's relevevant to your question is:
In other words, listening to the Dharma alone does not bring arhathood. Some stories of the great
saints, such as Sāriputta and Bahiya Dāru,ciriya, give us the impression that they awaken merely by listening
to the Buddha giving them a special teaching. However, it is imperative to remember the implicit
fact that they are all good dhyana-attainers in the first place. It is their dhyana-purified minds that make
them the perfect candidates for the attaining of arhathood. As such, it is not merely through listening that
they become arhats (although, on the other hand, this “listening effect” may occur in the case of streamwinning).