Let me quote a Einstein's definition of theory :

A savage finds a watch in the forest
He does not dare to open it but he wonders how can the pointers move
He had found also a car , some time earlier
" Maybe " he thinks " Inside the watch there are gears and springs
They make the pointers move same as the wheels of the car "

This is a reasoning by analogies, it is what scientists normally do
Maybe the watch is completely different inside
It does not matter
As long as it can explain all the observable features than it is a valid theory
However if this explanation is not consistent even with one only feature of the watch than the theory must be dropped


At Einstein's time digital watches were not available yet but up to a certain extent you can assume that a certain theory is valid ( springs and gears ) even though it is completely false ( quarz ) since different explanations can lead to the same conclusions

This is how science works