The ecological invasion problem in which a weaker exotic species invades an ecosystem inhabited by two strongly competing native species is modelled by a three-species competition-diffusion system. It is known that for a certain range of parameter values competitor-mediated coexistence occurs and complex spatiotemporal patterns are observed in two spatial dimensions. In this paper we uncover the mechanism which generates such patterns. Under some assumptions on the parameters the three-species competition-diffusion system admits two planarly stable travelling waves. Their interaction in one spatial dimension may result in either reflection or merging into a single homoclinic wave, depending on the strength of the invading species. This transition can be understood by studying the bifurcation structure of the homoclinic wave. In particular, a time-periodic homoclinic wave (breathing wave) is born from a Hopf bifurcation and its unstable branch acts as a separator between the reflection and merging regimes. The same transition occurs in two spatial dimensions: the stable regular spiral associated to the homoclinic wave destabilizes, giving rise first to an oscillating breathing spiral and then breaking up producing a dynamic pattern characterized by many spiral cores. We find that these complex patterns are generated by the interaction of two planarly stable travelling waves, in contrast with many other well known cases of pattern formation where planar instability plays a central role.