Why is Montgomery Alabama the capital of Alabama?

Montgomery is one of the most attractive city of Alabama .Have all the historical monuments and many other other things to do.Most of the events are hosted in Montgomery