Gaza was under siege and sanctions where the Israel and Egypt weren't allowing any dual-use product ( the kind of product which can be used for both civilian and military purposes) to enter Gaza, these items coould range from material processing, medicine to simple electronics. Yet still, Hamas was able to produce large quantities of rockets with different ranges. Anti tank weapon, drones, etc. They literally digged out pipes to use them for rockets.