Mail and Packages: Gmail Email Provider Setup

Would anyone be able to explain the best way to set up Gmail as an email provider for the HACS integration Mail and Packages? The set up seems to have straight forward documentation, but it is very confusing.

From what I can gather:

In Gmail, IMAP must be enabled. Gmail, all settings, forward and pop/imap, IMAP access, enable IMAP.

What is the purpose of the OAuth Setup section on this page. What do I do with the client ID and client secret once I follow the steps?

I did the above and the Mail and Packages worked.

Last week, it stopped working. I tried reconfiguring it but it did not work. I deleted it and configured it again. It is up and running!