Previously, yarn was installed globally via npm i -g yarn
or brew install yarn
/choco install yarn
and every project you are working on uses it to handle it's dependencies. yarn itself will installed in version 1, which is called "classic". If you update yarn in the version 1 branch over time, old projects could become not compatible anymore.
Here is "Modern yarn" kicking in, because it will be installed not globally, it will installed per project with corepack which is a tool from Node to handle different versions. Modern yarn starts from version 2 and is now 4.
Installed per project basis, you can operate your projects with different yarn versions independently – a huge benefit in terms of compatibiliy. But in order to so, you have to remove yarn globally and reinstall it with corepack.