An Inner Class is a member of the class it is enclosed in, in the same way that the fields of the enclosing class are members of that class. Instances of Inner each belong to a specific instance of Outer, and cannot be created without an Outer. That is why you can't extend Inner from a class that is not an Outer.
Notice how each instance of Inner prints out the value of the instance of Outer it was created from. This is because they are part of the enclosing object and can directly access all of its fields and methods, just like non-static methods in that class can. That is why you can only extend Inner from classes that are an Outer.
If we add the following static method to Outer it will fail to compile: