Maybe your writing an app that deals with some obscure data feed and feeds it into some home automation. Maybe the data comes in a format your language doesn't have a good library for right now. If its easy enough (as github and all try to make it) maybe you publish it as an experimental library for your language.
Someone else looking for that functionality for a work project sees your contribution and either contributes or forks and develops a better tested / maintained version.
If your submitting code for vanity, I can see less use, but a lot of it is public because traditionally Github would charge for private repos... people got used to just making anything that wasn't commercially sensitive open.