A 301 redirect is a permanent forward from an old page address to a new one. Visitors and search engines land on the right page automatically.
In plain words
A 301 redirect is a message saying "this page has moved for good". A person opens an old link, and the site instantly sends them to the new address. They never see a 404 error.
This matters for search: Google and Yandex transfer the rankings the old page has earned to the new one. Without a redirect, the page starts from zero, and old links from social networks and directories lead nowhere.
Redirects are set up when addresses change, when moving to a new domain, during a redesign or when merging similar pages.
A furniture factory rebuilt its site, and the category addresses changed. A 301 redirect was set up for every old link, and the site did not lose visitors from search.