Actually, Cruz was the beneficiary of some of the most bizarre electoral circumstances in Senate history. Out of 7.6 million voters in Texas, only 1.4 million showed up on a sweltering day for the Texas Republican primary in 2012, of which 479.079 votes were cast for Ted Cruz (34.2% of the primary voters, and only 6.3% of the total number of voters in Texas). His mainstream Republican opponent beat him by 12%, but failed to get 50% of the votes, so they staged a runoff in which Cruz got 631,316 votes out of the 1.1 million votes cast in that second election.
Once he was the Republican nominee, it was easy to beat the Democrat in the heavily red state of Texas. As crazy as Texas may be, you and the media have widely overstated Cruz’s mandate. He represents a small percentage of right wing partisans who vote in primary elections.
In an open primary system like that used in California, Cruz and his moderate Republican opponent would have been the last two standing in the general election and the moderate would have won easily, garning all the Democratic votes, plus the moderate Republican votes.