301 redirection is used when you URL is change permanently.
For example your website url is example1.com, then you replace domain name with example2.com
But when someone find content related to example1.com, then Google give him link of example1.com (Here Google don't know that your URL is changed.).
But when visitor click on example1.com, Here you have to use 301 redirection to example2.com. Thereby Google assume that now your new url is example2.com. Then second time Google provide link of example2.com.
instead of this, if you will use 302 redirection, then Google don't upgrade its directory and again Google provide link of example1.com