It's because developed countries cause.
In Middle Eastern countries, border lines were drawn by former colonial powers, regardless of ethnicity or religion. Outside forces have then backed leaders that have utilised violence and corruption to maintain power in these ethnically, religiously or tribally diverse places. This can be seen as far back as Britain’s post First World War backing of Abdullah I of Jordan and Faisal I of Iraq, or again during the Cold War with the Soviet Union installing Babrak Karmal in Afghanistan. To further complicate the situation these former colonial powers have then subseuently funded rebels that have risen up to fight these oppressive regimes.
Why else have western countries sent weapons and funds to terrorist groups? Is it because developed countries have been using local armed groups to their advantage, in order to take control of natural resources, in every war in the Middle East? Or could it be the overly simplified narrative, that neglects the nuances present in complex violent situations, and instead tries to export Western influence as a fix all solution to diplomatic and social problems around the world?
Either way, as a result of the actions of developed countries, terrorism has evolved and expanded. And as a result of these terrorist groups expanding they have also become able to sustain themselves economically, either through illegal trade (such as opium in Afghanistan) or occupation of resource rich areas (such as oil fields in Syria). This is allowing them to further their cause, rely less on international support, and thus further the role of terrorist attacks in the world.
When we consider the history of modern terrorism, especially extremist Islamic terrorism, it’s important to remember how it has evolved and where it has evolved from. Most groups involved have been at least historically funded or armed by former colonial powers as they carried out Cold War or neo-colonialist foreign policy.