Stalin had effectively consolidated his power through the late 20s and early 30s in Russia. Society moved from the relative pluralism of NEP to increasing regimentation in the 30s. Hierarchical, monolithic structures were increasingly the pattern. Stalin's total control over almost every aspect of Soviet life was accomplished through a series of purges and mass arrests. These were sparked by the assassination of S. M. Kirov in 1934. Kirov, who was Leningrad Party Secretary, had been a potential opponent for Stalin.
Mass repression began by 1936 and did not really subside until 1939. The party was purged, particularly of anyone viewed as a potential threat to Stalin's power. But not only: of the Central Committee elected at the XVII Party congress in 1934, 70% were executed. Of the regular delegates, only 59 of the original 1966 survived as delegates to the next congress in 1939. Show trials of well-known figures were arranged to inspire others to submit. Political and cultural leaders admitted openly to absurd charges (encouraged by torture or the hope for clemency) and were then imprisoned or executed.
At a 1937 meeting Stalin arranged an "intensification of the struggle" against "enemies of the people," which led to mass arrests in all sectors of society. Leaders of any kind were particularly vulnerable: managers, military officers, intelligentsia, writers. The total number of arrests and deaths will probably never be known, but it was probably between 8 and 15 million, as much as 10% of the population of the country. The cities were particularly hardest hit, since most leaders lived there.
Arrests were made by The Secret Police
The Library of Congress Soviet Archive Exhibit has some interesting material on Repression and Terror.