Kansas City is in Kansas and Missouri because Kansas City is a rather large city; it is in Kansas but it crosses over the border and the larger part sits in Missouri, so it is considered a city in both Kansas and Missouri.
The total area of Kansas City, Missouri is 319.03 square miles. Kansas City is the largest city in Missouri with a population of over 2 million. The Missouri side of Kansas City is larger than the Kansas side by about 200 square miles.
Kansas City is not the capitol of any state. In general, when people refer to Kansas City, they are referring to the metropolitan area that spans two states - Kansas and Missouri. There is a Kansas City, Kansas and a Kansas City, Missouri.