If I found you in a roomful of attorneys, I’d surmise you were an attorney. If you and a team of contractors were remodeling my kitchen, I’d suspect you were a construction worker.
Likewise with Google. When it finds you listed under “attorneys” on a directory site like Yelp or Yellowone with other law firms, it concludes you are also an attorney. This helps your online visibility.