Some agents will represent both buyers and sellers; they are called "Dual" agents. In many cases, the same agent will list the property and submit your offer. In fact, they are required by law to remain confidential with both clients. There is nothing legally or ethically wrong here, however it is hard to understand how the agent can negotiate to the best of his or her ability on your behalf. Instead of becoming a negotiator, they often play the role of mediator.
It is easy to assume that no agent can represent buyers and sellers as well as an agent who declares for just one party or the other.
Buyers and sellers opt to use "Dual" agents to get a savings in commission. An agent who represents both buyers and sellers doesn't have to split the commission with other agents and may be willing to throw in some of that commission, which, in effect, will get you a reduced price.