Driving a cab is his job.
Playing tennis is their favorite sport.
Gerund phrases can be used as subjects in sentences with be and a predicate nominative. So, you can invert those sentences to:
His job is driving a cab.
Their favorite sport is playing tennis.
His job is to drive a cab, and not to sit around playing cards.
The emphasis is different. The meaning is basically the same but, let's say for simplicity's sake, the use of drive a cab after to is more objective oriented and is a predicate but not a predicate nominative. It makes a statement about his job. As opposed to just being informative.