Often, adding a random colour will produce a dis-harmoneous result.
Our perception favours some combinations over others as being more aesthetically agreeable. We refer to these combinations as being in harmony. We use other combinations to disrupt harmony to gain attention.
Many years ago, a chemist who also was an amateur artist by the name of Michel Chevreul came up with an organized classification of colours we now call the colour wheel. It has 12 hues which are arranged to display all of the pleasing relationships between and among them. Colours next to one another display adjacent harmony, close ones show analogous harmony, opposites show contrast, every third one shows tetradic colour harmony, every fourth hue shows triadic colour harmony, etc. Pick up a copy of the wheel and some of the concepts relating to harmony to try.
You've already noticed that adding a random colour to those will "clash" and look ugly or weird. After a little practice with the colour wheel with pure hues, you will feel more confident using tints, tones, and shades of the pure hues to produce more refined combinations.