I think it depends on the software developer. We are all motivated differently to achieve different things.
For example, I care a lot about doing great work, but not everybody is built that way.
Core Human Motivations
People generally want one of a few things - money, power, fame, sex, and love. We also have basic needs like food and shelter. Most everything boils down to those kinds of intrinsic motivations.
So, you might have a software developer who wants to be famous, so they might try and create a famous iPhone app.
Another developer might want sex/love/companionship so they create their own dating app.
Another developer might want to be rich so they create software that costs a lot of money (enterprise software).
Software developers are people. Same motivations as everyone else.
How Software Is Made
At the most basic level, I would say that software developers feel the need to “scratch their own itch.” That is, to solve their own problems.
Programmers tend to be better at solving their own problems than we are at solving other people’s problems. Success as a programmer often looks like solving your own problem in a way that a lot of other people appreciate.
For example, this website is as much about me creating the resources I wish I had a decade ago as anything else. It turns out after finding the answers for myself, it helps you and thousands of other programmers too!
The Path To Great Software
Now, what drives a software developer to make their project “great” or really top quality often comes down to how much other people care.
For example, many years ago I created this really cool WordPress plugin. It was designed for content marketing and I thought it was the cleverest and coolest thing ever. Unfortunately, nobody else did.
So, the whole thing died on the vine. If other people cared enough I would have made it better. If I had cared enough I would have made it better.
At the end of the day, to make anything great you have to care enough to make it great. For many projects, that kind of motivation doesn’t exist, but when it does it can be life changing.