This question seems of a type with the question of how could an electric eel evolve, and I don't think it is too terribly difficult to come up with a starting point and a path that could work. As a class they require thinking of acids or electricity only at their most potent levels.
First, acids do attack the digestive track, but really weak acids need not do so at a rate that endangers the organisms survival. So a starting point might be a digestive system only able to digest the easiest foods. Natural selection might then favor variation providing greater resistance to stronger digestive fluid allowing more choice of foodstuff.
Organisms do have some control over eating stuff that upsets their tummies and also in the strength of the acid they secrete. But evolution could favor animals that can eat stuff that makes their competition sick.
Next up how did cheetahs evolve their great speed? Shouldn't they have all died out when they were too slow to catch gazelles or escape lions?
Edited by NoNukes, : No reason given.
Under a government which imprisons any unjustly, the true place for a just man is also in prison. Thoreau: Civil Disobedience (1846)
I have never met a man so ignorant that I couldn't learn something from him. Galileo Galilei
If there is no struggle, there is no progress. Those who profess to favor freedom, and deprecate agitation, are men who want crops without plowing up the ground, they want rain without thunder and lightning. Frederick Douglass