Both California and Nevada had brief (but very different) territorial periods. California had been colonized by the Spanish/Mexicans for decades before the land was taken during the Mexican-American War of 1846-1848. At that time, American Californians declared the Pacific Coast as an independent republic, but it shortly yielded to control of the United States in July 1846 under occupation of federal troops. The "territory" was subsequently managed by the US military (1847-1849). With the discovery of gold in 1848, and the subsequent, famous Gold Rush of 1849, tens of thousands poured in from the "states" and from the rest of the world, changing the management of the California Territory (which had been official ceded by the Mexican government by treaty on February 2, 1848.
In late 1849, the US military governor called for a constitutional convention, and with the drafting of that document, California was managed as a state - ten months before actual statehood was granted on September 9, 1850. California's path to statehood was unusual and was a byproduct of military occupation, remote location, the sudden influx of tens of thousands, and the subsequent quick justification for statehood. As a result, California did not have a typical territorial period and "order" was maintained and passed from military control to state government.
Nevada had a different path. The western Great Basin was initially managed by Salt Lake City, the territorial capital of the Utah Territory. Mormons - members of the Church of the Latter-day Saints - settled along the eastern foothills of the Sierra where land was well watered and where they could exploit an opportunity for commerce, dealing with California-bound emigrants. When gold-placer miners settled near what would become Dayton in 1850, tension with the theocracy of the Utah Territory was inevitable: most of the miners were "gentiles" (i.e. non-believers) who did not owe allegiance to the Mormon faith and resented the distant judicial and government power in Salt Lake. Congress ignored pleas for a Nevada territory to be authorized in 1859, but with the big strikes of gold and silver of that year, thousands poured into the western Great Basin. The resulting communities of Virginia City and Gold Hill (over 3,000 by 1860) and Carson City, the renewed effort to gain territorial status won favor in Congress: there was a general feeling that Salt Lake City did not wanted to discourage mining because it would result in an influx of gentiles. Congress wanted to take real estate away from the control of a potentially rebellious Utah, and so they created the Nevada Territory in 1861, which was organized that autumn. The population of Nevada was probably around 10,000 at that time, with most people concentrated within 50 miles of one another. The territorial government was able to impose reasonable order on that small amount of land, but the expansive "outback" was largely beyond territorial reach.
Nevada population continued to increase, and in 1863, President Lincoln won Congressional authorization for statehood, pending approval of a constitution. This was largely because Lincoln feared he might mot be reelected and he wanted the three additional electoral votes from a pro-Union State of Nevada. Eventually, statehood was granted - October 31, 1864 - days before the presidential election.
The short-lived Nevada Territory was able to impose "law and order" on the territory with reasonable effectiveness largely because the territory was intensely urban and the communities were clustered within a few miles of the western border. Administration was facilitated by the tight geography of most of the settlement. In addition, Fort Churchill in the west and Fort Ruby in the east provided a federal military presence that augmented territorial (and then state) administrative needs.