Many lenders issue mortgages and then sell the mortgages on secondary mortgage market. They just earn issue fees for a living. There are many secondary mortage markets, such as run by Fannie Mae (for so-called conventional mortgage because they satisfy Fannie Mae guideline) or run by investment companies (such as for subprime mortgages, which caused 2008 crisis).
Some banks issue mortagages and keep them for themselves (collecting interests). This is called portfolio mortgage. Because they don't have to sell the mortgage, the banks could be more flexible in reviewing who they lend to.
Commercial mortgages are mostly for commercial properties include apartment buildings. If you only deal with single family units, you usually cannot get commercial mortgage.