Immigration Form G-28, the "Notice of Entry of Appearance as Attorney or Accredited Representative" issued by U.S. Citizenship and Immigration Services (USCIS), is used for one purpose only: to indicate that the person signing it is handling the case of an applicant for immigration benefits or relief, and is either an:
If you are a noncitizen submitting an immigration-related application yourself or are in removal proceedings and you do not have an attorney, you do not need to submit a Form G-28. You are not required to have an attorney represent you in immigration or deportation matters, though hiring one can certainly ease the process and prevent mistakes that can harm your long-term immigration prospects.
If you hire an attorney or accredited representative or supervised law student for help with your immigration case, you should expect that person to ask you to sign a Form G-28. (See When Do You Need an Immigration Lawyer? and How Expensive Is an Immigration Lawyer?.)
And if you do not intend to hire a particular attorney or relevant professional as your representative for immigration matters, but perhaps attend a consultation with one, you should absolutely refuse to sign this form!
If you decide at some point to fire (terminate your relationship with) your lawyer and switch to a new one, the new attorney will submit a G-28 in your case to USCIS, the immigration court, or whichever agency or body is handling your case. This will automatically substitute for the old attorney's G-28.
Once you sign Form G-28, the attorney is authorized to access your U.S. immigration file and to send and receive correspondence from U.S. immigration authorities on your behalf. (Your immigration file is confidential, so people outside the U.S. government can view it only with your consent.)
Having an attorney receive such correspondence in your case can be handy, in that the attorney most likely has a stable address and a good system for tracking cases. The attorney will immediately understand the significance of any communication that arrives from the U.S. government, and can alert you when immediate action is needed.
For example, if USCIS sends a letter asking for additional documentation before making a decision on your case (an RFE), the attorney can figure out why USCIS believes that information is lacking, help you figure out what will satisfy it in time for the USCIS deadline, and then prepare and send the document.
In many situations, you will receive a copy of whatever original document the attorney receives from the U.S. government concerning your case. There might even be times when the attorney receives a notification that you do not, particularly if you change addresses and forget to tell anyone. And even if you do the right thing and notify your attorney and the immigration authorities of an address change, the U.S. government sometimes loses change of address notifications and continues sending correspondence to old addresses regardless. In other words, it's good to have your attorney as a backup recipient of U.S. government correspondence.