When i say martial arts, i am talking about fighting styles with an organised syllabus and distinct style, from ancient Japanese peasants to European warrior man at arms. How did they develop effective techniques and whst would influence the differences in one style from another? For example, the fighting style of japanese ninjas to mongolians thst could wrestle?
We don't know how the earliest martial arts styles developed. For later martial arts, there tend to be three types of origin stories:
Divine inspiration. For example, received the techniques in a dream or vision, in a flash of enlightenment while praying, or being taught by god(s) or other supernatural beings (e.g., tengu).
Development of the new style during a period of solo study. This includes tales such as watching animals fighting and adapting those techniques to the human body, solo training in the mountains as a hermit, etc.
Learning one or more existing martial arts styles, and combining them or improving techniques in them.
The first two usually include prior experience in martial arts, and thus elements of 2 or more of these stories are often combined. The last type cannot explain how the first martial arts styles developed, and, realistically, neither can the second - the first martial arts styles ("with an organised syllabus and distinct style") would have developed from pre-existing techniques, with the new part being an organised syllabus.
How formal the syllabus is affects what is recognised as a style. Whether or not those who train under the founder of the style go on to teach their students the same style, and call it the same style, affects what is recognised as a style. For example, we see a variety of styles in boxing, but these are (usually) devoid of formal syllabi that distinguish between them - different coaches teach to the same formal syllabus, and the differences in what they teach are informal. Thus, the styles don't have the same recognition or persistence that we see in, e.g., karate or kung fu - each coach has their own individual style.
How did they develop effective techniques
Training and experimentation.
Take two children, give them sticks, and tell them to fight each other, and they will learn techniques (play can be training). The most basic techniques are very natural - untrained people can punch, slap, kick, grapple, and hit each with sticks. These things don't need to be rediscovered. What needs to be developed is how to do these things well. Training (whether play or deliberate) that includes a level of competition motivates improvement. If one member of the group develops an improvement, the others can learn it, and it spreads through the group.
A playful environment (which can still be present in serious training) affords the opportunity to experiment. People can try things, different things, and see what works.
and whst would influence the differences in one style from another?
Real differences in styles can result from:
Weapons. At the most obvious level, wrestling is different from archery which is different from swordsmanship. Similar weapons tend to result in similar martial arts. For example, there are many similarities between Japanese swordsmanship using the katana and Medieval European swordsmanship using the two-handed (or, if you prefer, hand-and-a-half) longsword. Differences between similar weapons can result in significant differences - for example, the Japanese katana is shorter than the European longsword and single-edged and curved, and some techniques differ as a result.
Rules. The major old unarmed martial arts are sports-oriented - they are mostly wrestling. Typically, there is a method of obtaining victory that is far short of killing or even incapacitating the opponent (e.g., throwing, pinning), and this greatly influences the style. Modern boxing differs from Kyokushin karate because boxing rules don't allow kicks or throws, and Kyokushin doesn't allow punches to the face (among other differences). Where rules are similar, fighters from different styles will usually fight in very similar ways. We can call this "the kickboxer effect", and it suggests that different styles are more different ways of learning how to fight than different ways of actually fighting.
Chance. As different groups train and experiment, and develop new techniques, their body of techniques will develop differently. For many things, the differences are minor, but in some cases, bigger differences arise. For example, some styles use a hook punch with a horizontal fist striking with the first two knuckles while others use a vertical punch striking with the last three knuckles (and the same for straight punches, too).
We can also add:
This doesn't always result in real differences. Sometimes, two styles can be distinguished from each other only by their names - their techniques are identical! Sometimes, the only difference between two styles is their kata/forms/patterns while their body of techniques remains identical.
The evolution of taekwondo shows a succession of changes. Initially, the only difference was the name (and the use of Korean language in teaching and for naming techniques, but this difference was present while the art was still considered "karate"). Next, an emphasis on spectacular techniques (such as jumping spinning kicks) was added, largely for marketing purposes, but also to make taekwondo a little different. Later, the Japanese karate kata (which were still being used in taekwondo into the 1960s) were replaced by a new set of patterns. At this stage, the base of technique was still essentially the same as that of Shotokan karate. Later, the WTF (now WT) competition rules (used for Olympic TKD) drove changes in technique, and modern Olympic taekwondo competition looks very little like the ancestral art.
A simplified story - martial arts other than Shotokan, including other Japanese karate styles and Chinese styles - influenced TKD, and TKD itself has a diverse range of styles, some with more influence from those other arts. The above story is the evolution of the predominant style. For further reading on this, see Alex Gillis, A Killing Art: The Untold History of Tae Kwon Do, ECW Press, 2011.