From the documentation: 

> Classes inherit this setting from a parent class when one class extends or implements another.

Theres additional information in the documentation for [`sharing` keywords](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm).