It also comes to good sales as well. Again in my example, I was originally approached for a single contributor personal contract. It was just me at the time. Within a couple weeks of working together, I quickly realized they were bringing on these individual devs left and right. I simultaneously pitched the client on expanding our contract to multiple contributors, AKA becoming a true vendor, while also recruiting and hiring a team behind the scenes (again, networking - I pulled from past coworkers and friends who could get the job done, so the hiring process was far from exhaustive, but saved critical time). It was a risk, but it worked out and I was able to stitch together the team and win the contract. We became their de-facto “engineering team” of about 5 devs, and I set up a corp entity and began processing invoices and running payroll for my new employees.
Use accounting software from day one. Hire a corporate attorney. Worth every penny. Spend as little as you can to make your employees as happy as possible. Do not run payroll in multiple states unless you absolutely have to, or be prepared to deal with L&I and revenue departments for every state you have employees in (see: accounting software, corp attorney). Just a few of the lessons I learned along the way.
Where could I learn more about these kinds of opportunities? Does it come from networking, domain experience?