Earlier quoted context omitted.
You contact them. They are typically pretty vocal online, so finding them is not that difficult.
You mean, cold email them? Just pitch them and ask if they have surplus work?
There is a small split for how you would freelancing vs. consulting via agencies in my experience.
For consulting, you will usually only be brought on if you have a special skill set that the agency themselves can't fill out, and often only if their client specially requests those services. So consulting work via agencies is much rarer in my experience.
For freelancing, as long as the agency is doing well there is almost always something to do, and ~20% of their tech teams consist of freelancers, so it's not really "surplus work" but more their part of their normal mode of operation.
Of course, all of this are just anecdotal data, and may vary widely from region to region.