Kansas Territory
From June 4, 1812 until August 10, 1821 the area that would become Kansas Territory 33 years later was part of the Missouri Territory. When Missouri was granted statehood in 1821 the area became unorganized territory and contained little to no permanent white settlement with the exception of Fort Leavenworth. The Fort was established in 1827 by Henry Leavenworth with the 3rd U.S Infantry from St. Louis, Missouri; it is the first permanent European settlement in Kansas. The fort was established as the westernmost outpost of the American military to protect trade along the Santa Fe Trail from Native Americans. The trade came from the East, by land using the Boone's Lick Road, or by water via the Missouri River. This area, called the Boonslick, was located due east in west-central Missouri and was settled by Upland Southerners from Virginia, Kentucky, and Tennessee as early as 1812. It's slave-holding population would contrast with settlers from New England who would eventually arrive in the 1850s. 
The land that would become Kansas Territory was considered to be infertile by 19th century American pioneers. It was called the Great American Desert, for it lacked trees and was dryer than land eastward. Technically, it was part of the vast grasslands that make up the North American Great Plains and supported giant herds of American bison. After the invention of the steel plow and more sophisticated irrigation methods the thick prairie soil would be broken for agriculture. By the 1850s immigration pressure was increasing and organization into a Territory was desired.
Kansas and Missouri
Missouri was formed out of the Missouri Territory as a slave state during the early 19th century. Northern states wanting to slow the westward spread of slavery hammered out the Missouri Compromise with southern states anxious to keep slavery legal; this compromise ensured that any state directly west of Missouri would be a free state where slavery would be illegal. Thirty-four years later, Kansas became a territory, but Congress passed the Kansas–Nebraska Act that allowed the territory's residents to vote on whether or not slavery would be allowed. Both pro-slavery and anti-slavery boosters flooded into Kansas, but due to the state's proximity to Missouri, most were pro-slavery men from Missouri. They successfully stacked the vote to form a temporary pro-slavery government. Tensions resulting from this would lead to Bleeding Kansas, a violent and bloody civil war that would foreshadow the much larger American Civil War. Violence and guerrilla warfare continued for several years thereafter until the American Civil War ended, with many unjust killings and lootings performed by partisans on either side of the border. This violence and war deeply harmed the relationship between the two areas, even after Kansas attained statehood and the war had ended.