If you want to margin something to center. You need to specify right and left margin auto. other wise you can give it any value as per your requirement.
Answer to your question: Why do you need to use “auto”
By setting the value of “margin-right: to auto” you’re telling the browser to calculate the space needed to center the section and apply that much margin automatically everywhere.
Note: You need to use four margin property, one width property and a max-width property inside section element.
I hope my reply will help you, let me know thanks.