A mortgage broker by definition is an agent who buys or sells mortgages for a principal on commission without having title to the property.
Let’s simplify it. A mortgage broker is a company/person that facilitates a mortgage between lender and client. I bet you're saying to yourself right now: “why don’t I just go directly to the lender and save myself money?” That would be true if all rates, costs and fees were created equal. However, they are NOT.
A mortgage broker will have access to wholesale rates which will be a lot lower than a retail lender. Mortgage brokers cannot charge a lot of fees that banks/lenders can charge. i.e. processing fee, junk fees, etc.
Wholesale rates are a lot better even compared to the same lender on the retail side. The reason that mortgage brokers are able to get wholesale rates are because:
Overall, both the lender and the broker have their benefits and there really isn’t a wrong choice, just personal preference. But at the end of the day, your loan is going to a lender no matter if you use a broker or not.