A redirect is an automatic forwarding instruction. 301 is the code for ‘moved permanently’. Anyone, or anything, visiting the old address is sent straight to the new one.
Google treats a 301 as a signal to replace the old address with the new one in its results, carrying over the page's standing in search. A 302 means ‘moved temporarily’ and is for short-term changes.
Redirects are essential when rebuilding a website, changing domain name or merging pages. Each old address should point to its closest new equivalent, not just to the homepage.
Skipping redirects during a website rebuild is one of the most common ways small businesses lose search traffic they spent years earning. If anyone is rebuilding your site, ask them how the old addresses will be redirected before it goes live.