They build a model of the universe's laws, as simple as they can get it while matching the evidence. They then look at other evidence they hadn't looked at before. It turns out, that quite simple models can predict a lot of different phenomena, which makes us reasonably confident in our assumptions that (1) the universe is governed by simple, fundamental laws; and (2) those laws are similar to our model.
If we make the assumption that our model applies everywhere and at every time (colloquially, that the laws of physics don't change), we can ask our models what happened in the past. Under our assumption, that's probably quite close to what actually happened. This assumption is called the "principle of induction", the "uniformitarian principle", the "cosmological principle", the "Copernican principle", and many other things besides.
The models are so good that when solar neutrinos were not as predicted, it turned out to be because of new physics (neutrino oscillation) not flaws in the solar model.
If we make the assumption that our model applies everywhere and at every time (colloquially, that the laws of physics don't change), we can ask our models what happened in the past. Under our assumption, that's probably quite close to what actually happened. This assumption is called the "principle of induction", the "uniformitarian principle", the "cosmological principle", the "Copernican principle", and many other things besides.