Class declaration within a class

I am going through open source implementation of a utility function and I see that the designer has declared classes within another class.
Something like this:

module abc;
class x;
  class y;
  endclass
endclass
  
  x x1 = new();
endmodule

Now, I have myself never used this before and I have not seen such usage in many examples.
What is the reason it is coded like this? Any drawbacks/pitfalls or advantages?

In reply to verif_learner:

A nested class declaration makes the inner class declaration local to the outer class. /This means only the outer class can see it. SystemVerilog already has packages that provide similar functionality, which is why you rarely see nested classes.