J. Lawrence Broz has written a fascinating paper on history of central banking. He points most central banks were developed to finance wars – Riksbank in 1688, Bank of England in 1698, Bank of France in 1800, First Bank of United States etc.
The main idea goes like this. The Governments were always under war with someone else and incurred huge expenditure. So, people were worried that govts would default. The Govts faced both credibility and time consistency issues (whether govt will honor its debts). Hence, central banks were set up that served as institutions to lend to governments. The central banks in turn solved both the credibility and time consistency issues. Hence, it was a win-win situation for both – The Government gained credibility that it would not default and Central banks got privileged rights to be the banker to the government.
Over a period of time wars declined. Then central banks leveraged their privileged status to become the central banks as we know them now.
There is another paper I pointed out which looked at reasons why politicians decided to delegate powers to central banks to determine their own goals. This was a more current situation perspective. In the era of wars, the above paper tells you why central banks came into being.
I don’t have the time to discuss the paper in entirety. But it is a must read. Excellent discussion on political economy