An agent that represents a writer is called a literary agent. They can work for all types of writers. Agent usualy get writers work and they sort out any deals to hopfully get them more money. Dependin on how much the writer is paid depends on how much the agent is paid so they would try to get a good deal sop that they get paid more as well.
An advantege of having an agent is that some companys do not accept writers who don't have an agent. Also it makes it a little easyer to get work for more money if you have a good agent.
A disadvanteg of having an agent is that they might also have other writters that they reprasent. Also some agencys only specilise in one area of writing.