Actually here is the relevant bit from the judgement that addresses that ( Link:
https://www.sci.gov.in/pdf/JUD_2.pdf )
Page# 905
PART P
P. Analysis on title
P.1 Marshalling the evidence in Suit 4 and Suit 5
788. A stage has now been reached to marshal together the evidence on the
claim of title in Suit 4 and Suit 5 to pave the way for the ultimate determination of
the relief to be granted.
I The report of the ASI indicates the following position:
(i) Archaeological finds in the area of excavation reveal significant
traces of successive civilisations, commencing with the age of the
North Black Polished Ware traceable to the second century B.C.;
(ii) The excavation by the ASI has revealed the existence of a pre-
existing underlying structure dating back to the twelfth century. The
structure has large dimensions, evident from the fact that there were
85 pillar bases comprised in 17 rows each of five pillar bases;
(iii) On a preponderance of probabilities,
the archaeological findings on
the nature of the underlying structure indicate it to be of Hindu
religious origin, dating to twelfth century A.D.;
(iv)
The mosque in dispute was constructed upon the foundation of the
pre-existing structure. The construction of the mosque has taken
place in such a manner as to obviate an independent foundation by
utilising the walls of the pre-existing structure; and
(v)
The layered excavation at the site of excavation has also revealed
the existence of a circular shrine together with a makara pranala
indicative of Hindu worship dating back to the eighth to tenth
century.
A reasonable inference can be drawn on the basis of the standard of proof which
governs civil trials that:
(i) The foundation of the mosque is based on the walls of a large pre-existing
structure;
(ii) The pre-existing structure dates back to the twelfth century; and
(iii)
The underlying structure which provided the foundations of the mosque
together with its architectural features and recoveries are suggestive of a
Hindu religious origin comparable to temple excavations in the region and
pertaining to the era.