Child package vs nested package

what is the difference between

package P is
  procedure A;
end P;

package body P is
  procedure A is null;
end P;

package P.Q is
  procedure A2;
end P.Q;

package body P.Q is
  procedure A2 is null;
end P.Q;

and

package P is
  procedure A;
  
  package Q is
    procedure A2;
  end Q;
end P;

package body P is
  procedure A is null;

  package body Q is
    procedure A2 is null;
  end Q;

end P;

is it visibility ?

It’s visibility as you guessed. Nested units have visibility to the parent body (if they have a body), child units don’t.