It's called the spoiler effect and it's an issue of the voting system of "First Past the Post".
Imagine you have 4 parties, A,B, C and D. Let's say A, B, and C largely align on issues and D is the outlier. While 70% of the population wants either A,B, or C, if the vote gets split evenly then we see D wins despite on wining 30% of votes.
C says "Not cool man. I'm giving up and telling all my voters to vote for B". Now you have a three party system.
D isn't dumb and so he throws propaganda and budget to draw voters to A despite not agreeing with their policies at all. They are incentivized to split the vote because of how the system is designed. Voters get split between A and B again making 33% the victory threshold. D ekes out another win despite not reaching a majority. A and B decide to join forces to never let D win again and boom two party system.
Numbers are hyperbolic for demonstration but this is how it works. It's why sometimes third party campaigns get backed by the political parties least in alignment with them.
You will never solve the two party system without changing voting to one that negates the spoiler effect.