If you search for a history of banking in Wikipedia the first paragraph reads as follows:
The first banks were the merchants of the ancient world that made loans to farmers and traders that carried goods between cities. The first records of such activity dates back to around 2000 BC in Assyria and Babylonia. Later in ancient Greece and during the Roman Empire lenders based in temples would make loans but also added two important innovations: accepted deposits and changing money. During this period there is similar evidence of the independent development of lending of money in ancient China and separately in ancient India.
Banks were clearly one of the earliest professions to emerge and their main purpose was to lend money and meet one of the most long-standing needs in the market. They then moved into accepting deposits and changing money and a new industry was born.
The basic idea was that you received interest on the money that you deposited with banks, plus some additional services, and banks would then have access to large amounts of capital that they could then lend out at higher interest rates thus turning a profit.
Fast forward a few thousand years and the industry became much larger and more complicated as banks tried to drive more and more profit from the money their customers had deposited. Instead of just lending out a percentage of all their deposited cash, banks started borrowing against their deposits and borrowing against their lending to the point that they were lending out far more money than they actually had. This all works well when the market is moving up.
But then we had the economic crisis of 2008 and property and indeed most asset prices came crashing down. This led to the bank’s aggressive strategies becoming unraveled and they have been deleveraging and trying to restore some order to their operations and their balance sheets ever since.