TL;DR mock is a tool for building RPM packages. You can use mock to build packages for many different versions of CentOS/Red Hat and Fedora. The main advantage of using mock to build RPMs instead of rpmbuild is that mock builds RPMs in a cleanroom environment. mock does this by creating a chroot and performing the RPM build in the chroot. This article explains how to setup mock and how to build RP