The capitals of the states here in the United States of America are an odd lot, geographically speaking. That is, where in the state they are located follows no one particular pattern. Some are situated very near the geographic center of the state, such as Columbus, OH; Indianapolis, IN; Pierre, SD; and Bismarck, ND. Some are on a body of a water along the edge of a state, such as Boston, MA and Trenton, NJ. Carson City, NV; Cheyenne, WY; and St. Paul, MN are also situated only a few miles from their borders. Lansing, MI; Phoenix, AZ; Sacramento, CA; and Santa Fe, NM are not very close to the center of their respective states, but are generally towards the middle in at least one direction. On the other hand, Lincoln, NE is nowhere near the center geographically, but may be close to the population center of the state, given the distorting presence of Omaha, Nebraska's largest city, on its eastern border. A similar situation exists for Harrisburg, PA.
Why were there such great differences into where state capitals are placed within their states? It is largely a matter of history of the respective states. State capitals were often at the center of an area of early settlement and development, or along a water route or railroad route. While placing the capital at the geographic center helps limit the maximum travel time from any point in the state, if the population distribution is heavily weighted due to history of settlement, transportation facilities, or topography, then another location may make more sense. And in other cases, the capital's location made a lot of sense in such cases when it was made the capital, but no longer does. Thankfully, in this era of airplanes and automobiles, it is much more convenient to reach any state capital from anywhere in a state, intervening mountains and lakes notwithstanding.