There are several types of banking institutions, and initially they were quite distinct. Commercial banks were originally set up to provide services for businesses. Now, most commercial banks offer accounts to everyone.
Savings banks, savings and loans, cooperative banks and credit unions are actually classified as thrift institutions. Each originally concentrated on meeting specific needs of people who were not covered by commercial banks. Savings banks were originally founded in order to provide a place for lower-income workers to save their money. Savings and loan associations and cooperative banks were established during the 1800s to make it possible for factory workers and other lower-income workers to buy homes. Credit unions were usually started by people who shared a common bond, like working at the same company (usually a factory) or living in the same community. The credit union's main function was to provide emergency loans for people who couldn't get loans from traditional lenders. These loans might be for things like medical costs or home repairs.
Now, even though there is still a differentiation between banks and thrifts, they offer many of the same services. Commercial banks can offer car loans, thrift institutions can make commercial loans, and credit unions offer mortgages!