Their main uniting factor and the main reason why anyone would join them is because of the ideology that they portray themselves as. Of course in the eyes of most of the world, they're nothing more than fear-mongering killers that is about as cartoonish in their evil as North Korea is, if not worse if you can believe that. To no surprise, terrorist organizations like ISIS are some of the most despised people in the world, so much so that folks like Pope Francis {known as a humble, peaceful man by many} has called them out and agreed that they had to be stopped.
Individual terrorists may have no real idea why they fight outside of said ideology, but I would imagine that they do it because of the camaraderie that comes with joining a terrorist group, and it's always easier to push those ideals when you have plenty of like-minded folks on your side.