Pricing and agency compensation

I’m curious about the various ways freelancers and small agencies price and charge clients for work. I’m most interested in how agencies charge for paid ads, like is it a percentage of ad spend? I just don’t know.