If microwaves only penetrate up to a few cm of food in a household appliance before being absorbed and transferring energy to water molecules, than how are microwaves able to communicate through long distances I.e satellites to phones. Should the microwaves transfer all their energy to water vapour in the air?
If microwaves only penetrate up to a few cm of food in a household appliance
It's important to understand why this is true.
Microwave ovens work because they are very carefully tuned to a very specific resonant frequency of water, 2,450 MHz. The microwaves generated by the magnetron bounce around in the oven until they excite a water molecule, at which point they disappear and the water absorbs that energy.
If you don't tune to that very specific frequency, that just doesn't happen, and the microwaves happily go on their way... right into space. And you don't have to change the frequency very much for this to happen - as noted in another post, Wifi works at 2.4 and doesn't cook you, even though that's only 50 MHz away, a 2% difference.
Communication via microwaves doesn't necessarily take place on the same $2.5Ghz$ as our microwaves use, but use a multitude of different frequencies for different forms of communications. No communication takes place on a spectral line where there is a strong $H_2O$-line. WiFi for example uses $5Ghz$ and $2.4Ghz$ for example.
Electromagnetic radiation is considered microwaves between $300Mhz$ and $300Ghz$so there is plenty of room left to use in the microwave window. Frequencies where communication takes place are chosen where the atmospheric absorption is low and where there is minimal RFI (man-made Radiofrequency Interference). 5G for example is between $30$ and $300$GHz and 4G is around $2.6$GHz.