I was just wondering, given the major population difference between the two.
It became the capital of New York in 1797. It is one of the oldest surviving settlements from the original thirteen colonies, and the longest continuously chartered city in the United States. Modern Albany was founded as the Dutch trading posts of Fort Nassau in 1614 and Fort Orange in 1624.
The population difference between the two at the time was minimal, if you include all of Albany county and all of NYC (including LI/SI).
Population has nothing to do with determining a Capital City, though.
Usually it's about geographical advantages for commerce/trade. Albany is at the end of the Hudson, a major trade route in the area.