Even if it is true that a percentage of engineers essentially do nothing at all, I would expect that an even bigger percentage of engineers are building things that do not have a market on account of bizarre decisions from leadership.
However, many times Engineering teams are asked to build something that is speculative. Leadership and the Product team thinks they are building something that could make money in the future and justify the investment.
Other times folks are building something which is directly attributable to existing customers revenue. It may be that it won't bring in any additional revenue, but it will reduce OPEX and improve the margins of the business.
It's a good idea to understand which type of project they are working on from the business perspective.