This is far from the true most of the time. In my experience the only places where pay doesn't mostly depend on skills/smarts/effort are government and to a lesser degree the big monopolies/oligopolies like Comcast.
The cool thing is that negotiation skills are a hundred times easier to learn than programming skills. A few weeks of effort will net you thousands or tens of thousands. The effects are cumulative over your life, so the sooner you start, the better.
Your experience is definitely different from mine them. Even in startups, I regularly see developers with less skill being paid much more than their better colleagues merely through negotiation.
The key determinants of salary, in order of importance, are:
1. Negotiation ability
2. Years of raise accumulation ("experience")
3. Skill