The Prophet ﷺ said that an ant once bit one of the prophets, so he ordered the ants' nest to be burned, and it was burned. Then Allah revealed to him, "A single ant bit you, and you destroyed a whole community of communities that glorifies Me?" For indeed they glorify Him.
أخبرنا إسحق بن إبراهيم قال أنبأنا النضر وهو ابن شميل قال أنبأنا أشعث عن الحسن نزل نبي من الأنبياء تحت شجرة فلدغته نملة فأمر ببيتهن فحرق على ما فيها فأوحى الله إليه فهلا نملة واحدة و قال الأشعث عن ابن سيرين عن أبي هريرة عن النبي ﷺ مثله وزاد فإنهن يسبحن