Beginnings
The Sturmabteilung ('Storm Division', or SA) was the Nazi Party's paramilitary organization, for over a decade the basis of the Party's power before having its leadership liquidated and becoming sidelined when its continued legitimacy became a threat to the Reichswehr (the German Army before the Nazis renamed it the Wehrmacht, literally 'defence power'), business interests, and the Party itself. Until it was utterly marginalized in 1936 it was central to Nazi power, and the brown-shirted 'stormtrooper' (each regional SA formation was called a 'storm') became the ubiquitous symbol of Nazism.
The early members of SA were hard men steeled by the brutality of the German Revolution which followed World War I, specifically in the bloody suppression of the Munich Soviet. In the chaos of post-war Germany, Communism was a powerful political force. As Communism swept seemingly unstoppably across Eastern Europe, Lenin's prediction that Germany was the perfect candidate for revolution (as the most developed country on the Continent) seemed like it might come true. Apalled by the atrocities that followed the October Revolution in Russia, there was real fear of a Red Terror in Germany.
The situation seemed desparate in Bavaria, where a motley band of anarchists seized power and declared a Soviet. Their new Foreign Minister telegraphed Moscow, complaining that the deposed President had stolen the keys to the Ministry toilet, and went on to declare war on Finland and the Republic of Württemberg because 'these dogs have not at once loaned me sixty automobiles. I am certain we will be victorious.' This tragicomic regime was soon pushed aside by a more serious group of Communists who soon had a 'Red Army' of 20,000 at their disposal. The federal government proved unable to deal with the crisis, and so the task fell to paramilitary groups.
Eventually the Munich Soviet was bloodily repressed and thousands were killed. In the disorganized fighting and repression, many young Germans and returning veterans from the front gained a taste for political violence. The right-wing paramilitaries were subsequently let off with the lightest of sentences for their atrocities, and some drifted into the Nazi Party's 'Gymnastics and Sports Section', a cover name from which they first derived the acronym SA (from Sportabteilung). As just one of many competing radical right-wing parties, the SA did not have a particularly large membership at this point. The organization began to grow at a faster rate when its leadership position was assumed by Ernst Röhm, a very well-connected ex-Frontsoldat and radical nationalist.
Ernst Röhm
Röhm was a very violent and simple man whose hatred for things such as 'bourgeois routine', 'peace' and 'decadence' was merely an extreme example of this thankfully now near-extinct personality type. He was not a political man and instead revelled in violence for its own sake, directed against what he saw as the hypocritical world of bourgeois values and morality. Typical of the generation that had fought at the front and then returned to a country now ruled by a democratic and socialistic left wing, he turned violently against German society and found refuge in political violence. His peers and those among the young who imitated them did much to bring down Weimar democracy.
In 1922 Röhm became the head of the SA, and soon augmented it to 800 members. The ostensible purpose of the organization was to guard Nazi Party meetings. Every political group in the country had one like it, be it the Reichsbanner of the Social-Democractic Party, the Red Front-Fighters' League of the German Communist Party or the Steel Helmets of the Nationalists. On top of their ostensible purpose these groups spent their time fighting each other in the streets and engaging in criminal activity (this is especially true of the Front-Fighters' League due to the intimate relationship between the underworld and Communism).
The organization was banned after Hitler's attempt to seize power in the 'Beer Hall putsch' in 1923, but was soon reconstituted due to the reluctance of the authorities in much of Germany to prosecute right-wing groups with anything like the vehemence they went after the left. The German judiciary and police apparatus had a remarkable degree of continuity with the Imperial organizations, which were used to equating socialism with criminality. The unsympathetic attitude of these groups towards Weimar democracy (a key to its downfall) meant they did not face the threat from the right with any consistency, and so the S.A. continued to come off better in the courts when brought there due to political violence.
Phoenix
However, when the SA were reconstituted Hitler demanded that they be made subordinate to the Party. Röhm had a nasty habit of independent-mindedness and political views that differed from Hitler's, and Hitler was not willing to tolerate such things: such was his authority over the minds of men (not physical force, for he had none; what force existed in the Nazi movement lay in the SA), he got his way and Röhm resigned from politics. The brownshirt organization became more closely integrated with the Party, and would now play an indispensible part in bringing it to power.
Hitler's trick in attaining power was that he seemed at once respectable and extreme, plebian and sophisticated, intransigent and moderate. The Party in the late 1920s had two sources of power - the physical force that could be deployed by the brownshirts, and the legitimacy and authority which Hitler and the Party exercised over its followers. The seizure of power came when the latter seemed to be reaching its limits, and so it was necessary to exercise the former to legitimate and facilitate a power grab.
The seizure of power
It all worked something like this. The SA would go onto the streets by night, create civil disorder by murdering Communists and fighting Social Democrats, and in the morning Hitler would give a speech condemning civil disorder and calling for strong government to eliminate the Communist menace. If the SA perpetrated some particularly violent atrocity against the opposition, Hitler would publically disavow it and privately encourage it. To the wavering voter unsure of the path to national salvation, he appeared a respectable politician who roused particularly high passions in his followers: passions that surely would be reined in if he gained power. To the brownshirts, he appeared as devilishly clever to fool the idiot bourgeois world so thouroughly.
When the Nazi seizure of power took place in 1933, the leadership of the Party had calculated that they had reached their electoral peak. It had turned out that democracy could not be totally destroyed by its own means as Goebbels loved to boast, but that a vital blow of terror was needed to destroy the embattled system. After the Reichstag suffered an arson attack at the hands of Dutch Communist Marinus van der Lubbe, the SA were deployed in a final blow against the Communists. They brutally arrested, tortured and killed anyone suspected of connections with the Communist Party, and it was now that the first concentration camps were established for political prisoners. The death rates inside were massive.
Röhm was back in command of the organization by now, although Hitler held the nominally highest position in it. In the first six months of 1933, when the Nazi seizure of power took place, the SA were showing a worrying predilection to the sort of spontaneous activity they used to engage in. Firstly there was the boycott of Jewish shops, which started sporadically and was only after the fact made a central policy, then just as quickly abandoned when it proved unpopular. Secondly there was the spontaneous occupation of all trade union offices and the dissapearence of their money and property into SA coffers. None of these were activities that the Party were hostile to, provided they were carried out at the right time: but now was not that time.
Demise
Things were made worse by Röhm's steady accumulation of personal power, his homosexuality, and questionable political views. For instance, Röhm thought he could be loyal to the heir to the throne of Bavaria, the top general of World War I, and Hitler all at once. Clearly he hadn't understood the point of totalitarianism, which could permit no other loyalty other than to the Leader. Furthermore, Röhm dreamed of incorporating the SA into the Reichswehr. As the latter had been limited to 100,000 by the Treaty of Versailles, this would have resulted in the several million men of the SA swamping the regular army. This didn't please the army at all, and it didn't please Hitler that Röhm appeared to imagine Germany's future was a military or fascist dictatorship; quite incompatible with his totalitarian aims.
Furthermore, big business was worried by the activism of the SA. Many of the rank and file took the 'Socialist' part of 'National Socialist' a bit too seriously. This name had just been a tactical device, designed to ensnare socialists: why would a true German choose to be a socialist when he could be a national socialist? Other men in the Nazi Party power structure also feared Röhm's influence, and so despite Hitler's personal like for Röhm it became necessary to liquidate him in a coup d'état. Other political rivals could conveniently be brushed aside as well.
With a dossier of manufactured evidence at his side and the SS as his personal police, Hitler moved in on June 30, 1934, the Night of the Long Knives or Blood Purge. The hierarchy of power and organizations in the Nazi state was endlessly complicated, and the fate suffered by the SA was actually slightly unusual. The Nazis tended not to wholly liquidate a troublesome organization, but merely to create another one and marginalize the old one. Only Hitler and Himmler really knew who was really powerful at what time and who just had ostensible power. However, because the SA was led by such a famous and popular man and because his organization was at this time the embodiment of Nazi power, it became necessary to physically liquidate the leadership faction (an action more typical of Stalinism).
With its leaders arrested and killed by the SS, the SA was soon marginalized in the Nazi power structure, and in 1936 its members began to be drafted into the Wehrmacht. After about 1935 the Nazi Party never faced any organized opposition (the 1944 attempt on Hitler's life being an anomaly), and so such a coup d'état was never again necessary. However, in totalitarian regimes, the absence of actual opposition is only the beginning of the terror for the rest of the innocent population.
Sources for quotes
Hannah Arendt, The Origins of Totalitarianism. Volume Three: Totalitarianism (New York, 1968)
Richard Evans, The Coming of the Third Reich (Penguin, 2004)