They deduct their fees and relevant expenses and send you a check for the remainder. You need someone capable of doing all of the above in a timely, professional fashion. If you are uncertain about an agent who agrees to represent you, ask for the names of clients you can contact for recommendations. Anyone can enter the business at will. You need to make a careful assessment of the qualifications and ethics of any agent you consider hiring.
Some agencies require a separate agreement.
Others rely on the agency paragraph in a book contract. In either event, know what you're signing and the consequences should things not work out in the future. Hiring an attorney to review a contract before you sign, may save you money, not to mention aggravation, in the long run. Try airing your complaints directly. If the situation is not resolved, seek different representation for your next work.