Google, Microsoft, eBay (and some other corporate companies) use 4 colors in their logos: Blue, Red, Green and Yellow.
How does it help their branding? And for which kind of companies does it work. too?
The colors are complementary - The four colors are roughly evenly spaced across the color wheel, which is a basic approach to creating complementary colors. Technically, this approach is called using a tetradic color palette. For more, you can read about color theory.
Colorful palettes create a sense of openness, diversity and optimism, which are positive for a consumer brand. The following chart shows some of the alternative approaches to using color to create user brand experiences:
Color is excellent for global brands. There are several reasons for this.
It may help to see a side-by-side comparison of colorful logos vs monochromatic logos. Here are some prominent global brands using colorful and then monochromatic colors.
You will see that the monochromatic palette communicates a sesne of prestige, seriousness, neutrality and focus, whereas colorful palettes tend to communicate a sense of playfulness, openness, informality, and creativity.
Note that visual layout often mimics the color palette....the logos on the left have deliberately dissonant layout...rough edges, irregular shapes or abutting characters. These are all designed to enhance the sense of playfulness that the color palette communicates.
Although it's a subject for a longer post, I deliberately included the "old" and "new" versions of the Microsoft and Apple logos....you can see how the brands have evolved their color messaging as Microsoft has sought to become a friendlier global consumer brand and Apple has evolved into a premium/aspirational consumer technology company.
I guess they use these colors because they form the "4 unique hues".
I would not go so far as to attach a certain meaning to this. While colors do have a certain psychological meaning, there is no argument to assume that those are the reasons for their choice. It could be anything ranging from purely esthetical reasons to personal preferences mixed with historical reasons. There is also no need to assume that the reason for the choice are the same for each company you mentioned. The only way to really find out would be to address these different companies and ask them.
As for Microsoft, the idea behind their logo is, according to Microsoft general manager, Jeff Hansen:
"It signals the heritage but also signals the future — a newness and freshness."
And also posted on their blog is:
"The symbol's squares of color are intended to express the company's diverse portfolio of products."
They do not explain why they chose exactly these 4 colors.