Judicial independence and democratic erosion. What institutional design can weaken or shield the judiciary?

I will try to distinguish factors to consider in the relationship between contexts of democratic erosion and judicial independence. In this regard, 3 points of view can be adopted: external, internal, and decisional. Each of these views includes certain components that make it possible to assess the strength or weakness of the courts to maintain their independence.