Tawoos Yamani (may Allah have mercy on him) says that I found many companions (may Allah be pleased with them) of the Prophet (peace and blessings of Allah be upon him) saying that everything is connected to destiny, and I also heard Sayyiduna Ibn Umar (may Allah be pleased with them both) saying that the Messenger of Allah (peace and blessings of Allah be upon him) said: "Everything is connected to destiny, even foolishness and intelligence."