How a satellite is able to communicate with Earth is better answered with How does Voyager 1 send signals to Earth? and How does NASA get information from space probes?. I'm only going to answer why it is much easier to have an orbiting satellite communicate with Earth than a rover, which I believe is the crux of your question.
First of all, there are landers that have communicated directly with Earth. Opportunity and Curiosity can both talk directly to Earth. However, they can't have as large of a dish as an orbiting satellite can. In fact, the landers don't have a steerable antenna, as that would be too difficult, and thus can only communicate with Earth when Earth is in about the right part of the sky (Directly overhead), which should happen once a day.
Communication with an orbiting spacecraft is much easier, as the distance is as much as a million times closer. Power is lost as a square of distance, thus that is a very significant factor! This allows for a lower gain antenna, which allows the two to communicate much easier, and allows the orbiting spacecraft with it's much larger steerable antenna to do the heavy lifting!