In CentOS 8 and its derivatives such as AlmaLinux 8, the dnf package management utility has been chosen as the default replacement for yum. This decision was made for several reasons:
Improved performance: dnf has been designed to optimise performance and speed over yum. It uses the libsolv library to process repositories and make package installation/removal decisions in a more efficient way.
More features: dnf provides some additional features such as better transaction support, better package search and better dependency management.
More active development: At the time of the transition from CentOS 7 to CentOS 8, the yum project was deemed obsolete and the developers decided to move to a more modern and actively developed alternative.
While yum will still work on CentOS 8, the use of dnf is recommended for a more efficient and modern package management system.