Inheritance, as taught in OO in the 1990s (at the time they said OO would end world hunger), has surprisingly few legitimate uses. I would not use the expression "violates encapsulation", I would say rather that the inheritance "Engessa" the subclasses. "90s" Delphi-type languages, which only had inheritance as a means of code reuse, had deep class hierarchies in their framework (came up to a Chart in the product box, size A3, to paste on the wall), and broke everything with each new version.
It gets even more left-handed when multiple inheritance is allowed. That thing about "Square is subclass of Rectangle but also subclass of Polygonoregular"... then "Circle" should be subclass of "Polygonoregular" or not? At least they discovered in the 1990s that multiple inheritance was not a good idea, and the only really legitimate use was adherence to interfaces, that is, simple inheritance of a concrete class and multiple inheritance of purely abstract classes (Java has always been like this).
Sometimes that cast is perfectly adequate. In all the visual frameworks I know, each screen control is descended from a View class (Uiview on iOS, View on Android, etc.) In this case the inheritance is appropriate because the derived views have to rigidly fit the protocols and the functioning of the base View; and the base View implements the full basic functionality (it is it, not the derivative, that will "chat" with the video driver, etc.) If the View changes its modus operandi, it is legitimate and desirable to "break" all derivatives of View, preferably at compile time, so that they can be retrofitted.
But in most cases this hierarchical inheritance is a bad way to reuse code. Even the legacy of interfaces is obsolete, the "protocols" of Objective-C/Swift or "Duck Typing" of interpreted languages are much better. These languages also allow adding methods to a class without needing to define a subclass ("composition"). These features allow frameworks with "shallow" hierarchies. as is the case with Apple’s Uikit: https://finalizedotcom.files.wordpress.com/2012/12/uikit_classes.jpg
In summary, the overuse of inheritance was a consequence of the few resources of the available languages, the "novelty" of OO techniques, and the misunderstanding of the "real" OO as implemented in Smalltalk.
Very enlightening answer. Practically a history lesson! :)
– utluiz