The short answer is AI labs. The companies building coding models need large amounts of real source code to train and evaluate them, and they pay to license it. They buy through licensing programs that collect code from many owners, check it, and take it to labs in batches.
This is a different shape of deal from selling a product. A lab wants a copy of the code and the git history behind it, under a license that lets it train on that copy. Your app, users and brand stay with you, and nothing is handed over. You keep the code, keep using it and keep the right to license it again. Each license that closes pays you.
It is also the one route paying at scale for code that never succeeded commercially. Shelved products, dead startups, internal tools, abandoned side projects and legacy systems all qualify. The code does not need users, revenue or a working build. It needs to be real, and it needs to be yours.
What kind of code do AI labs license?
Private code with a real history. Labs already have the public code on the internet, so what they lack is the software that companies and developers kept to themselves. That covers products, internal tools, services, scripts, mobile apps, games and the long tail of systems that ran a business for years. Any mainstream language counts, and older or less common ones can be in short supply. What lowers the value is code that is mostly generated, copied from tutorials or squashed into a few commits, because it says little about how real software is built. Code you do not own cannot be licensed at all.