At some point, defendants and their attorneys inevitably discuss the facts underlying criminal charges. An attorney needs to know about the case in at least some detail. Otherwise, the lawyer can't effectively advise the client about the viability of going to trial and any theories of defense (for example, self-defense or someone else being responsible). With the client's information and the prosecution's discovery, the lawyer can begin to develop a strategy. But not all lawyers want the same minutia.
Some defense lawyers don't want to know what the client did and didn't do, so as to avoid being boxed into a particular version of events. Those who don't want to know precisely what happened probably have in mind ethical constraints. They cannot ethically (or legally) offer evidence that they know to be false. (ABA Model Rules of Professional Conduct, Rule 3.3.) This means, for example, that they can't allow their clients to commit perjury—that is, to testify to a version of events they know to be false.
On the other hand, many lawyers want to hear from their clients exactly what happened. They typically encourage their clients to be truthful for the sake of crafting an effective defense. Only that way can the defense attorney know what will—and won't—work. For example, a lawyer representing a woman charged with killing her boyfriend might want to know everything that happened both during the incident and throughout the course of the relationship. If the client admits to her lawyer that she killed the man, but describes tremendous physical and emotional trauma she previously suffered at his hands, the lawyer may be able to present a convincing defense based on the history of abuse.
A defendant admission of guilt to a defense attorney doesn't necessarily mean that the case won't—or shouldn't—go to trial. For example, a defense attorney might advise a "guilty" client to go to trial because:
There's nothing stopping an attorney who knows a client to be guilty from arguing that the jury should acquit. The attorney can look for mistakes by law enforcement in investigating the case and poke holes in the prosecution's theory in order to raise a reasonable doubt. In fact, that's a criminal defense lawyer's obligation—to always protect the constitutional rights of the accused so that those who are actually innocent won't be convicted. Zealous advocacy is also designed to force the government to honor our civil liberties, such as the right of suspects—innocent or guilty—to be free from physical coercion.
The best strategy for someone facing criminal charges is to follow the lead of an experienced, trusted criminal defense lawyer, and no matter, to be truthful with that lawyer. An attorney who has your best interests in mind will advise you regarding the possibilities and your best course of action.