In a typical transaction in Minnesota, the seller contracts with a real estate broker to list their property. As a part of that contract, the listing broker agrees to pay part of the compensation to the broker representing the buyer – or the selling broker.
When you hire a broker to represent you as a buyer, you will agree to be responsible for paying the broker, but make sure your contract states that your responsibility is reduced by any amount that your broker receives from the seller or sellers broker. In the majority of cases this will cover your brokers commission. There will be a small per transaction fee that the broker charges at closing which will be disclosed to you in writing when you sign the buyer representation paperwork.
Your agent will receive a percentage of the selling broker commission as compensation from their broker. Keep in mind that most real estate agents are independent contractors and pay their own license fees, MLS dues, health and car insurance, taxes, marketing expenses, team and administrative salaries and all of the many other expenses that come with running a business.
(This is typically how a real estate agent gets paid in Minnesota, information may vary by company and state.)