Both phrases express exactly the same idea (He’s a lawyer) using 2 different grammatical structures.
There can be a slight difference between the two sentences.
For example, answering a question about his profession, you would use
— Quelle est sa profession ?
— Il est avocat.
But answering a question about who this person is, you would use
— Qui est cette personne ?
— C’est un avocat.
I think it’s the same grammar rule than english : it’s and he’s.
“He’s” will refer to someone, “it’s” refer to everythink else non-human, like njzk2 explained.
I think it is not a grammar thing. The answer depends on the context.The first is clear for the profession and the second is for the identity which is unique to distinguish the one from the others. “Qui” is referred to the someone. So I think it is a question to understand the context and has so little with the grammar.