I noticed that stocks often go up and down together, for example I see MSFT goes up 2% and then if I look at Alphabet it's also up at around 1.5% and then if one goes down, the other goes down similarly. I'm not talking about longer term as I observed correlated movements during the day. I don't think it's connected to the latest news or something. Why does it happen? Should I look at Nasdaq index to predict this or there is something else that I'm overlooking?
While Fattie is ultimately correct that there needs to be no reason for any phenomena in the markets, there are reasonable reasons to believe that the returns of Microsoft and Google should be more closely correlated than a random pair of stocks in the market. They sell somewhat similar products and have similar sources of costs. So news that may effect future revenue/costs of the two companies will likely effect them both in similar ways. While this isn't always true, there is evidence that changes in economic variables such as revenue and cost tend to be more similar in companies in the same industry than in companies in different industries. So, it as stock prices should be linked at least loosely to future net revenue is reasonable to believe their price changes should be more closely linked as well.
The NASDAQ index is a composite of (mostly) tech stocks and MSFT and GOOG are some of the largest components in that index. So, changes in the prices of MSFT and GOOG directly effect the index price simultaneously. Therefore, the NASDAQ rather unlikely to be a predictive or lagging indicator for either of the stocks. It's best to think of the NASDAQ as an average of how all tech stocks are changing currently.
Response to Question in Comments:
Though the economic variables I talk about above are generally released publicly for most companies about once a quarter. It doesn't mean that traders aren't trying to guess the implication of new information and how it may effect companies constantly throughout the trading day. Generally, news of any sort will effect companies similarly. If one company moves too far out of line, without a good reason, traders will think it is a mispricing they might profit from and will trade until the price is inline.
As for underlying variables, that is a much, much harder question. Some people would argue that the pursuit is pointless, though I'm not among those. But for a large corporation there are millions of choices daily that effect the future revenue of a company. Instead, often professionals will often approach the problem from the opposite viewpoint and assume that the stock will move with the broad market and just try to understand what occasionally will cause it to move in a different direction.
Often times, the people that attempt to predict the market, will judge various indicators to see if a particular sector is going to rise. That is what you are seeing. Google and MSFT are both in tech, and so if all companies say they will spend more in research and development, it is likely most companies in that sector will receive a rise in revenue, which probably means a rise in profits.
In that case, using workable numbers, lets say that tech spending will increase by 1,000. XYZ company controls 10% of tech, so they will receive 100 more in capital. if their profit margin is 20%, then that will translate into 20 more in profit. Then divide that number by the number of shares outstanding and you have the price that the stock should increase without much speculation.
All companies in tech should rise in proportion of their market share. This is why you often find similar companies moving in the same direction.
Quite simply, nobody has a clue why or how the stockmarket works.
Famously, these two guys "Merton and Scholes" created the most complex ever model of markets (if they were on this list, they'd now be confidently telling you the "answer" to your question...).
Of course, "Merton and Scholes" were just two staggeringly inexperienced zeros who knew nothing; they went on to lose about the largest amount of money ever lost on the markets in one go. Complete idiots. (They were assisted by - could you make this stuff up? - one of the chiefs of the Federal Reserve.)
One of the single biggest financial failures in history. Their work had the value of a 3 year old scribbling. Was the lesson learned? Of course not: more people come along with market "theories," to explain the type of thing you ask.
Off the top of my head, you can give a few rationales,
"I don't think it's connected to the latest news or something." It seems very obvious to me that good or bad news would change the market
The big index funds. I'm not sure if you know but most "investing" just goes in to index funds which (quite simply) buy a certain list of stocks which is published by a newspaper. (No ... really ... you read that all right.) You can see that the funds in question have to buy or sell together those stocks. (It's important to remember, this is just a suggested theory - as an example - it may be utterly, hopelessly, wrong.)
Similar categories. Many of the stocks you mention are indeed "related" - they are all "tech" stocks, you could say. Makes sense they may move together. it's possible this is the simple answer to your question: if you compare, like oil companies, travel companies, car manufacturers etc, you may not see as much correlation.
Answer - nobody has a clue.
If someone did, they'd be rich and wouldn't tell us.