Shahrukh Khan is the richest actor. From the time he came into films, his one and only goal were to become famous, rich and powerful (in that order). Hence, once he achieved fame, he launched headlong into acquiring wealth. Apart from films and advertisements, he performed extensively on stage shows, unabashedly danced at private functions, for a huge fee of course.
He has a keen business sense, hence his foray into a production house, VFX studio, investing in IPL cricket league, purchasing key properties in India and around the world gave him unimaginable returns.
Aamir came from a privileged wealthy film family and was keener on perfecting his art of acting than chasing money. But he got his wealth anyways as he is way above Shahrukh and Salman when it comes to quality films and acting. He also had fewer advertisements contracts or private function dance invites.