Hitting metrics or whatever else causes you to be successful in your organization is not the same as doing a good job. It is possible, for example, to get raises and promotions while ruining your company and destroying all value for your customers. It is also possible to be the only one delivering any value, while actively working against organizational goals. Management, or whoever else is defining success for you, is not infallible.
Intrinsic motivation is a real thing. You don't have to let your boss or your parents or your teachers tell you what it means to do a good job. You can decide for yourself.
People who just grab libraries from npm and don't take their imports seriously are not the ones delivering value in the places where I've worked. Far from it. Those are the people whose "work" you have to re-do weeks or months later because it didn't actually deliver value. Often times it doesn't work at all, never worked, never compiled, etc. But those people are long gone because they're busy being "successful" and moving on to other roles, creating negative value in other parts of the organization.
You say that only successful people know why their job exists, and unsuccessful people are blind to organizational value. In my experience, you couldn't be more wrong.