Easy: half of it took place within their borders. When you interact with other countries you do so on their terms, because they are sovereign.
Of course, if a crime is only half-committed in one country, then it is also only half-committed in the other country (presuming it is a crime in both). So either of the countries must be free to prosecute.
Of course, if a crime is only half-committed in one country, then it is also only half-committed in the other country (presuming it is a crime in both). So either of the countries must be free to prosecute.