Early Spartan history is shrouded in myth, and we know little for certain. However, most of our evidence suggests that Sparta was an ordinary Greek polis for much of the Archaic period. Eighth-century burials and dedications at temples show a taste for luxury and finely crafted goods; fragments of the seventh-century Spartan poet Alkman are all about flowers and music and pretty girls. Written works from the Archaic period make reference to the warlike habits of Argos and Euboia, but Lakedaimon is known for the beauty of its women and the skill of its dancers. There is no hint of any military focus even in the arguably ancient Great Rhethra (the earliest outline of Sparta's political institutions, preserved by Plutarch).
Yet, when we get more detailed descriptions in the Classical period, all this seems to have changed. Suddenly Sparta is subject to the Laws of Lykourgos. This semi-mythical lawgiver was praised for turning Sparta into a ruthlessly austere community of equals, who prided themselves in their aloofness from luxury and immoderate pleasures, and lived in a society structured around constant social control, with a horrific educational system meant to turn Spartan children into unflinchingly obedient warriors whose contempt for death practically defined them.
There is endless debate among scholars as to when the change came. The traditional view is that the prolonged Messenian Wars of the late eighth and seventh centuries forced the Spartans to adopt a more warlike way of life, which ultimately allowed them to conquer Messenia and turn its people into helots. The contemporary poet Tyrtaios is often cited in support; his apparent references to a generation-long war and the martial and bloody-minded content of his battle hymns evoke a world of peoples embroiled in a bitter struggle for their very survival.
The trouble is, though, that Tyrtaios makes no mention of Lykourgos or any of the institutions he is said to have introduced. There is no word in Tyrtaios of the tent groups, the helots, the boy-herders, the agoge, the Ephors, or the military units into which the Spartan militia was later divided. No other contemporary source mentions any of these things either. In fact, the Classical sources are our earliest sources for all the typical features of Spartan society. Clearly, Sparta did not become Sparta until long after the Messenian Wars. So how did it happen?
One version, suggested by Matthew Trundle,^1 is that Spartan wars of conquest brought them up against the strong Peloponnesian state of Tegea in the middle of the sixth century, and their initial defeats forced them to change their ways. It is clear from Herodotos' account of this period that the Spartans' northern neighbours gave them a few nasty shocks at this time, and it is not unthinkable that they would have responded by gearing their entire state for war. Their reforms were intended to create a more effective militia army, while their external policy simultaneously changed from one of outright conquest and absorption to the construction of a network of unequal alliances later known as the Peloponnesian League. This model proved very successful in the ensuing two centuries, with Sparta spending most of that period as the undisputed leader of Greece.
Another view, championed by Stephen Hodkinson^2 (among others), has the Spartans gradually adopting the "Spartan" institutions through the later Archaic period in line with the way other Greek states were doing so. None of its new features (like state education, pederasty, etc.) were particularly special at the time. Hans van Wees^3 has shown that there were plenty of Greek states that had a class of serfs like the Spartan helots, and the Greeks themselves saw so many similarities between the Spartan system and that of the states on Crete that they supposed Lykourgos had travelled to Crete to gather inspiration for his reforms. It was only during the Classical period that Sparta began to look strange - not because it had adopted these institutions, but because it had held on to them for so long, when all other states had eventually abandoned them. In this view, Sparta was not really special - just backward. Instead of moving on from old ideas, it doubled down on them, gradually developing more and more extreme versions of societal concepts that had long gone out of style elsewhere.
For Hodkinson and Van Wees, the fundamental aim of Spartan reforms was not to create a more effective army but to secure the internal stability of the community. Throughout the late seventh and sixth centuries, many Greek city-states struggled with tensions between rich and poor that periodically erupted into open conflict, while a toxic culture of competition among the elite led to factional strife and tyrants seizing power in many states. Sparta and Athens, the best attested city-states, dealt with these similar tensions in radically different ways. While Athens moved towards more comprehensive legislation and attempts to balance the political influence of rich and poor (which would eventually evolve into Athenian democracy), Sparta instead asserted the dominance of the leisure class by stripping the poor of all rights and privileges, and then worked to create a semblance of outward homogeneity among the wealthy to prevent the ruling elite destroying itself from within. The result was a wholly new Sparta that was unlike other Greek city-states. Tellingly, the Classical Greeks mostly admired Sparta, not for its martial prowess, but for its great internal stability.
References
M. Trundle, 'The Spartan Revolution: Hoplite Warfare in the Late Archaic Period', War & Society 19.2 (2001) 1-17
S. Hodkinson, 'The Development of Spartan Society and Institutions in the Archaic Period', Mitchell, L.G./P.J. Rhodes (eds.), The Development of the Polis in Archaic Greece (London, 1997), 83-102
H. van Wees, 'Conquerors and Serfs: Wars of Conquest and Forced Labour in Archaic Greece', Luraghi, N./S.E. Alcock (eds.), Helots and their Masters in Laconia and Messenia: Histories, Ideologies, Structures (Cambridge MA, 2003), 33-80
Edit: rephrasing for clarity
There's a lot of information about the creation of Sparta from Plutarch's Life of Lycurgus. Bear in mind that Plutarch was a 1st century CE historian. Lycurgus is claimed to have lived around or prior to the first Olympiad, so 776 BCE+. According to Plutarch, Aristotle claimed that Lycurgus helped arrange the first Olympic truce. Eratosthenes and Apollodorus used a list of Spartan kings to determine Lycurgus lived before the first Olympics. Timaeus claimed there were two different Lycurguses, the elder living in the time of Homer. Dieutychidas claimed he was an eleventh generation descendant of Heracles. Lycurgus could possibly be an amalgamation of different people or purely a mythical figure.
Long story short, Lycurgus is accused of wanted to become king and not wanted to live with this suspicion, he leaves Sparta. He travels throughout the Med. from Crete to Asia, and possible to Egypt.
[5] The Lacedaemonias missed Lycurgus while he was away and often asked him to return, because for them it was only the title and the prestige that distinguished their kings from the masses, whereas Lycurgus, they could see was a natural leader with the power to get people to follow him.
When Lycurgus returns to Sparta, he has a plan to bring about a revolution and constitutional change. He goes to the Oracle of Delphi and
He claimed that when he asked for lawfullness the god had granted and promised him a political system of such quality that it would leave all the rest behind.
He also allies himself with the "best" Spartiates, eventually 30 of the leaders march with arms into the city center. The current king, Charilaus, thinks they are going to kill him and hides, but with promises of safety he reveals himself and basically turns over the government to Lycurgus.
Lycurgus' first reform/rhetra is giving Sparta and mixed constitution. It is a combination of a monarchy, oligarchy, and democracy; each represented by the kingship, the elders, and the assembly.
Next,
[8] The second, and the most revolutionary of Lycurgus' constitutional reforms was the redistribution of the land. There was terrible inequality, crowds of paupers without property and without any means of support were accumulating in the city, and wealth was entirely concentrated in the hands of a few people. In order to banish arrogance, envy, crime, luxury, and those more chronic and serious political afflictions, wealth and poverty, Lycurgys persuaded them to pool all the land and then redistribute it all over again, so that everyone would live on equal terms and with the same amount of property to provide income, In the future the only ascendancy that would seek would be assessed by the criterion of excellence...
Next, he revokes all gold and silver coins and made iron the only legal tender. Plutarch claims that once iron became the only currency all crime disappeared from Lacedaemon. He also organized community mess halls where people would eat common foods together. Rich members of society could not have luxurious meals, but had to eat the same as the poor. Strangely enough, this was a lot worse for rich people that the redistribution of their land and the lose of their precious metals.
[11]It was apparently this reform above all which made the rich members of Spartan society angry with Lycurgus. They formed themselves into a party to oppose him and used to band together to shout him down and express their irritation. Eventually, the came a time when he[Lycurgus] had to run out of the city square under a hail of missiles from them.
He takes shelter in a sanctuary, but a man named Alcander catches up to him. Alcander strikes Lycurgus with a stick and knocked out his eye. Lycurgus, undeterred, stands in front of the mob which is horrified at the sight of his damaged eye.
As for the strong Spartan women, Lycurgus implemented a physical regime for unmarried women including: running, discus, wrestling, and javelin throwing. The idea was that strong healthy women would create strong children. There is a classic quote of a foreign woman telling Leonidas' wife Gorgo, "You Laconian women are the only ones that control your men." Which she replied, "That's because we are the only ones who give birth the men."
Lycurgus is credited with taking the young boys of Sparta and forming them into herds. The smartest and strongest of the boys becomes the herd leader. The boys were often compelled to fight and compete against each other by the older Spartan men.
This kind of got really long. There is a lot of more info in Lycurgus, like Laconic speech/sayings, how Spartan men would get wives, and the erastes/eromenos relationships between Spartan men and boys.