I am currently reading up and thinking about how and why speech developed in humans. My theory is that stuttering emerged when evolution developed a new pathway to prioritise generation of message as opposed to the manner in which the message is conveyed.
Our ancestors were animals like today's apes. They were able to express primitive thought processes and emotional states with sounds, a sequence of sounds, and body language of different forms (like pitch, length, intensity). Due to still unclear reasons, our ancestors developed more sophisticated thought processes and the ability to encode these thoughts in a language. Having a language had a huge evolutionary advantage because language allows to put thoughts into a message, to send the message to another person where the message creates a similar thought in that person's mind.
However, evolution only equipped our ancestors to deliver non-language messages like name calling, pointing, and so on. The brain put all the focus on how to deliver the message, but little cognitive resource on formulation which message is the most effective. Now, with the development of language and more sophisticated brain processes, spending more time on the message as opposed to how to deliver the message had an evolutionary advantages. Therefore a new pathway developed that would run the how-to-speak in the background and give our ancestors more cognitive space to work on what message we want to convey. We have the ability to speak with thinking on how we have to speak because it works automatically. We can concentrate on how to manipulate our fellow humans with the most appropriate message!