Are the Presidential Primaries Rigged?

This presidential election, spectators of all political persuasions are complaining about the nominating process. Donald Trump is particularly unhappy, calling the Republican system “rigged.” Bernie Sanders has also criticized the voting process. Their supporters are outraged.

Is it justified? Is the nominating process undemocratic? And, if so, how did we get here?