How is commission paid to an agent in the USA?

At closing, the escrow or attorney pays the brokerage firms according to the settlement statement; brokerages then pay the individual agents under their internal split arrangements.​