No protection as a component is a black box from the compiler point of view. You can direct the elaboration with a configuration to tell it which components map to each entity. Otherwise the tools will have their own rules how it searches for the entites. IIRC, Quartus first searches the work library (ie. the library you compiled "some_entity" in to) then other libraries.
In your instance, with no configuration, you probably have a recursive module - which is legal.