All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
This Prophetic narration is evidence that it is desirable to supplicate when hearing the crow of a cock because it saw an angel. However, this narration is not evidence that the cock crows only when it sees an angel, or that it never crows if it does not see an angel.
There is no great benefit in investigating such a matter; knowing this matter does not bring any benefit, and not knowing it does not lead to any harm.
For more benefit, please refer to Fatwa 88296.
Allaah Knows best.