I want ask what is different between www.google.com and google.com because both of them dont have same ip. Does anyone know why?

Those are two different dns records. there is no requirement for them to be the same. However, i understand why you may be asking since most of the time these two types of records point to the same website.

I dont know the answer but i suspect that it has to do with the way they want to route traffic and where they want the traffic to arrive.

Now a day most of browser contain building "www.". So when you type google.com then it's automatically convart on www.google.com.