The compiler only looks at the reference type, which in this case is NavigableSet<?>. You won't be able to add anything through a NavigableSet<?> reference, because the wildcard means that the actual object pointed to might be of any generic type. For example, it could be a TreeSet<Integer>. If you understand why you can't add an Object to a TreeSet<Integer>, then you understand what is going on.
The only generic collection references you can add elements through are those references which establish a lower bound for the type of the contained elements. You can do that by simply providing a specific type, as in NavigableSet<
String>, in which case you can add String and any subtype of String. Or you can do it with the <? super X> syntax: If you have a NavigableSet<? super Integer> reference, you can add Integer or any subtype of Integer to it.
But these type of references don't work because they don't establish a lower bound for the generic type:
NavigableSet<?> // Unbounded type (except for the absolute upper bound, which always is Object)
NavigableSet<? extends Integer> // Upper bound, but no lower bound