I suspect that autonomy plays an important role here.
For writing apps, you need only your computer. You don't have to interact with other people a lot.
For medicine, fundamental physics, you need a huge amount of resources, and you need to cooperate with lots of people.
It seems that smart people prefer complete independence.