I would compare it to having research published in a journal. You have to do all this work to get published, but in the end, the journal doesn't pay you for it. However, if you are published in highly respected journals, that helps build up your reputation and career. I view OSS the same way. You don't get paid directly by an OSS project, but the bigger and more prominent ones you contribute to, the more it boosts your reputation and career.
I would compare it to having research published in a journal. You have to do all this work to get published, but in the end, the journal doesn't pay you for it. However, if you are published in highly respected journals, that helps build up your reputation and career. I view OSS the same way. You don't get paid directly by an OSS project, but the bigger and more prominent ones you contribute to, the more it boosts your reputation and career.
To continue the analogy, it also means others can corroborate and build upon your work, often citing it in order to get their own work done!