What happens is .. the Doctor and companions land outside Troy at the end of the Trojan War. They are captured by the Greeks, except the TARDIS is captured by the Trojans and brought inside the city. This leaves the Doctor in need of retrieving the TARDIS and in alliance with the Greeks. Eventually the Doctor decides to advise the Greeks through building the Trojan Horse, which is the historical record of how the Trojan War ended through the Trojan Horse subterfuge.
Obvious the time Quandry here is.. would the Greeks have thought this up on their own?
FWIW at the end of this series one of the Companions, Vicki, decides to stay behind as she had fallen in love with one of the locals.