How Civil Wars End: The Influence of Rebel Groups