Oh, man. This is a loaded question. If you were to survey inmates in prisons, about 99.5%. Some do admit their crime up front, just say "see what you can do for me", etc. Even some of those people change their tune once they've been incarcerated for a while. I suppose if you ask prosecutors, it'd be move like 0.5%.
The Innocence Project has done a lot to free wrongfully convicted inmates. Individual attorneys do, too. Seems like there are more and more of these stories every year, certainly more than when I graduated law school over 20 years ago. Then again, there have been some serious advances in DNA and other investigative tools. I was just reading a day or two ago about yet another inmate in Dallas County, TX being released after serving more than two decades in prison (on death row, I believe), and the article indicated that county had experiences a high number of exonerations, releases, etc.
The sad fact of the matter is that there really is no way to tell. You could Google, check the Innocence Project to see how many people they have freed, etc. Even some of those freed are still open to some debate, at least in the minds of some people. Judges take issue with prosecutors suppressing exculpatory evidence and order a new trial, but half or more of the witnesses are dead or scattered to who knows where. DNA appears to at least cast serious doubt in some cases, but isn't the reverse of a "smoking gun" in all cases. Witnesses come forward to claim they were pressured by cops, etc.
The system is run by humans. It involves humans at every level. That means errors are possible at every step of every level. And sure, guilty people go free, too. Some people are convicted of crimes less serious than charged (and that they are guilty of) for various reasons. Still others are convicted where they perhaps should not have been.
Illiustrative case: in Washington, it is a felony to threaten to kill another person, even if the threat is made to a third person...I read an appellate case last week upholding convictions for two such threats where it was clear the guy was reaching out to a social work for help because of what looks like was really a problem stemming from a mental illness...said he kept having dreams of killing two particular people and when asked if he thought he wanted to kill them, he said yes...the people weren't even in the room, didn't hear it, and I'd bet that what the guy really needed was hospitalization and treatment, possibly for an extended period of time.
If we had a "guilt" machine to determine who was really guilty of what, we could answer the question. Because no such device exists, it's impossible to answer the question. I won't use the question to crawl up on the soapbox and rail against the system, judges, etc. I've been trained by some truly brilliant people, and I've had cases where jurors spent hours poring over documents, evidence, testimony, etc. Funny thing...I've won cases where people were paying me and others where I was appointed...yet the prevailing theory among many people still seems to be that appointed attorneys are all lousy or expensive attorneys are all good. In my experience, good and bad attorneys exist in both realms.
Win or lose, if a jury clearly, conscientiously deliberates a case, I appreciate their work. I still hate losing more than just about anything in life, but it happens. Some cases leave a bitter taste in my mouth for years, and others I've won and was quite amazed at the outcome. I also get a great deal of satisfaction from winning a hard-fought case, client's guilt clearly in doubt (especially with high stakes, no priors, etc.). Like a pitcher, some days I have better "stuff" than others. Each trial is important and I try give my best effort. Sadly, it is true that others don't or really should be doing some other kind of work.
It's a cliche', but I really do believe we have the best system in the world. It doesn't always work properly, and some times the better lawyer beats a potentially stronger case. I've had some clients I felt were likely innocent (you try to avoid the assessment to maintain objectivity, but it can be tough in some cases, and those keep me awake at night). At the end of the day, all a defense attorney can do is his or her best to try to avoid seeing an innocent person go to jail, and that all clients' rights are protected as fully as possible.