When the theory is 'tweaked" over time in a purely ad hoc manner, how can it not 'explain" whatever it's supposed to explain?
Exactly. Now you're starting to understand what the purpose of science and scientific theories are. Scientific theories are models, and as such they often require fine-tuning in order to be better models.
Visualize this: You are constructing a model of the known solar system, and let's suppose that you have some truly advanced technology to construct a true-to-life model of the solar system. Using this model, you can hopefully predict where planets will be at certain times, when the best time to observe a planet or a moon feature is, etc.
You start with a very basic model - one in which the earth is immobile at the center, and the sun, moon, and other planets circle the earth. A good model to start with because it matches your observations - surely you can see that all these things go around the earth!
Then a couple guys come along and tell you that they've observed something that doesn't mesh with your model. The planet Jupiter, it turns out, has its own moons. No problem, you figure, and you start adding moons around Jupiter so that they'll also go around the earth. But there's another problem - turns out the planet Venus undergoes phases, somewhat like our own moon, but the phases conflict with your model. Your model doesn't predict the correct phases of Venus. Turns out the only way to make things work is to put the sun in the center, and put the earth in orbit around the sun. Major tweaking to your model... but when you're done with the change, you find that now your model predicts the phases of Venus just fine. You can look at your model and see what phase Venus will be in on January 21, and sure enough, January 21 comes around and it's...
Oh, almost right. Not quite right, it's off by a bit.
You discover, through some trial and error, based on what you observe of the planets' positions in the sky over a long time, that the shape of your orbits is wrong. The planets don't orbit the sun in perfect circles, as you had thought earlier. They orbit in ellipses. When you apply this new formula to the model, you find that not only does your model better predict the correct phases of Venus at the right times, all the other planets seem to fall into line as well. You've again tweaked your model to account for what has been observed, and now it is a better model.
Some time later, you discover that one planet in particular is not behaving as your model suggests it should. It does something odd - it seems to periodically speed up and then slow down. Overall the model is right except for these strange periodical accelerations and decelerations. What could cause that? One suggestion is that there's a missing planet - maybe one further out from the sun, one that hasn't yet been observed. You work this into your model and find that, indeed, if there were a planet at a certain distance from the sun, and was roughly the same mass as the known planet, it would have the observed effect. Now your model has predicted something else entirely, and later observation confirms what your model predicted - there is, in fact, such a planet out there. When it and the first planet approach each other, the first planet gets held back by the second - the braking. Then as the second passes, it sort of pulls the first one along a bit.
What if you had NOT found such a planet, though? Would you have insisted that your model was correct, and the planet had to be there even though observation said otherwise? You might try to improve technology to make better observational equipment, but after some time, evidence will show that the "extra planet" idea is wrong. You cannot then cling to the notion that the model is right. It has to be tweaked again. Either there is an alternate explanation, for which evidence could be found, or there is evidence that will suggest the alternate explanation. Either way, eventually the model will be tweaked again.
And that's how science really works. It has worked that way for over 300 years. This method has consistently produced better models, better theories, and more and more correct results. This method has allowed us to build on prior knowledge to extend our knowledge even further. It works - deal with it.