PS2s incredible post-PS3 sales were a three-fold factor.
1. New markets. The PS2 was released in markets that did not have official releases yet by any company before.
2. PS3 had a very slow start. It wasn't as accepted by the public or dev/pubs as the PS2 was. There was a not a graceful transition. PS3 was very expensive, PS2 was not (see next).
3. Price. PS2 had massive price cuts. Sub $100 price points in most markets. This made it an easy impulse buy, second console, replacement, etc...compared to the $500-$600 PS3. New generation consoles and old generation consoles no longer have such huge price disparities meaning the older consoles (combined with backwards compatibility) aren't seen as a high demand market anymore.