Why is there terrorism?

The very definition of the word explains what it is and why it exists:Terrorism is the use of threat or violence mainly as a means of forcing others to do what one wishes. Another way to look at it is 'political bullying'.

It is an extremely useful military-type maneuver and it's effect always gets the attention of the opponent.

Terrorism and terrorist are words used by a sitting government to describe those that strongly disagree with them and use tactics that, in many cases, are the only ones open to them. It does not have to include violence but often does.
It should also be remembered that terrorists become freedom fighters when they win.
There are many examples of terrorist who became freedom fighters, perhaps the best known today is Nelson Mandela and the ANC.