Hamas has the ability to make rockets.
They traditionally have been inaccurate.
Iran has their own rocket building manufacturers there, and in northwest Syria (long-range rocket production). They supply Hezbollah and other terrorist organizations, and Hezbollah supplies Hamas. Also, from 2021:
Who Funds Hamas? Who Supplies its Rockets? Here's Everything About Gaza Militant Group
The Lebanese terrorist Imad Mughniyeh who blew up the Marine Barracks in Beirut specifically received arms and money from Iran. Iranian General Qasem Soleimani, (who Trump took out) and who commanded the elite Quds Force, described Mugniyeh as "the legend of our time," grief caused by whose loss was only second to that of Ruhollah Khomeini, leader of the 1979 Iranian Revolution. Soleimani stated that what made Mugniyeh unique was not his expertise in guerrilla warfare but "his attachment to something superterrestrial."
Birds of a feather, terrorize together.