The war between the three Realms seems mostly unrelated to the two, but Moriarty is there to kill Holmes, as it's his job as an Apostle of the Alien World.
The reasoning that Holmes was intentionally overlooking (because he instictively knew pursuing the question would only makes things worse) is that he is the first Apostle of the Alien God. He got made by the Alien God and memory wiped himself for undisclosed reasons before his Master summoned him to London, then moved him to Camelot. His actions in both Singularities prevented Goetia from preventing the Alien God's advent, and since then he's been a sleeper agent in Chaldea.
He dudeced that his purpose as an Apostle is [berserker_noise.2], and therefore the gods mixed in him are [berserker_noise.3].
Moriarty, on the other hand, is an Apostle to the Alien World, not its god. They came from the same system, but Moriarty has no loyalty to U-Olga. His goal was to kill Holmes then become the new boss of Chaldea to oppose U-Olga. For that, he needed to enter Chaldea through a Servant contract, but since he's a man of standards, he hates Fujimaru and tries to contract Kadoc instead, only to be foiled by Kadoc's climatic "Nah, I mean, I'm done being a traitor" moment.