There’s no point in comparing PS2 and PS5 in sales, it’s just not even remotely comparable really in any way. PS5 is so much more expensive, and a lot of people bought PS2s as a DVD player, not to mention it was the most inexpensive console throughout most of that generation, and had a one year head start vs the other two consoles.
Especially in Japan, where the console market used to be absolutely enormous, and now it’s essentially a handheld/mobile market with a very small portion being home console (non-Switch).