We pay competitive salaries and offer generous option grants, but it's not the reason why people join. I know this, because we typically work out the compensation once people have already decided to join (contingent on a fair offer, of course)
Developers (at least the ones we're trying to hire) want end to end responsibility, to do meaningful work, to not be micromanaged, and to have their voice and opinion heard and taken into account. They don't want to be another cog in the machine turning out code according to preprocessed requirements.
Our developers write their own user stories, go on calls with customers so they have the full picture, and can take on any responsibility in the company that isn't currently being handled well.
We also let you work from home and manage your own hours. You're an adult, we don't want to decide for you how you work best.
I'm open to hearing contrary opinions, but this has worked very well for us