I think the surface area of "problems that are possible to solve with a handful of programmers" is so that enormous that even if the capabilities of a handful of programmers stagnated, it would take decades or more to run out of profitable problems. Additionally, the capabilities of "a handful of programmers" increases over time as the best tooling available gets more capable, so the surface area of what is possible expands* over time as well.
* I'd argue that as tools improve, the number of solvable problems of a given value increases exponentially e.g. if you have a capability A and you introduce capability B, you can now do things that require only B or A and B, and if you then introduce capability C, that opens up (C), (A, C), (B, C), and (A, B, C) as new problems that are possible to solve.
Edit: For a concrete example, with tools like Stripe you can do payments-related stuff without being an expert in handling credit cards, and with tools like EasyPost likewise for physical mail, and with the combination of the two a single developer can now do any of the things that require either of those individually plus things like taking online payments and managing shipping on the best-cost carrier without any in-house staff and only a couple months of dev work.
* I'd argue that as tools improve, the number of solvable problems of a given value increases exponentially e.g. if you have a capability A and you introduce capability B, you can now do things that require only B or A and B, and if you then introduce capability C, that opens up (C), (A, C), (B, C), and (A, B, C) as new problems that are possible to solve.
Edit: For a concrete example, with tools like Stripe you can do payments-related stuff without being an expert in handling credit cards, and with tools like EasyPost likewise for physical mail, and with the combination of the two a single developer can now do any of the things that require either of those individually plus things like taking online payments and managing shipping on the best-cost carrier without any in-house staff and only a couple months of dev work.