Inflight WiFi is outsourced to a third party. Gogo is the most common by a lot. Getting WiFi up to an airplane is kind of tricky. Cell phone towers are specifically designed not to send signals upwards; that's why you lose your service so quickly. If cell phone towers sent signals upwards that power would basically just be wasted, so they don't. Most of the signal you *do* get is just reflected off the ground.
That gets at the meat of why Gogo is expensive too- they have their OWN network of cellular towers. They operate on a similar frequency to normal cellphones, but only on the lowest band. There are a little over 200 towers in the US, compared to over 200,000 cell sites (towers + antennas mounted on buildings). There are [2-4 antennas](http://concourse.gogoair.com/gogo-atg-4-work/
) on the underside of the plane that radiate omnidirectionally. The antennas feed a modem (or two) and get converted into WiFi signals inside the cabin.
For transoceanic flights there are no towers. These flights use a separate antenna on top of the plane that talks to satellites- standard satellite internet on the Ku band. Gogo contracts out with a few companies for this, but the satellites are all relatively similar. they sit in geostationary orbit around 22,000 miles away. Omnidirectional antennas obviously aren't enough for this- you need to point a very good beam at these satellites to get a good connection.
For context, that distance is roughly the circumference of the earth. The target is a bit bigger than the broad side of a barn. It's like if you stood in front of a barn, took aim, then turned 180 degrees and shot all the way around the planet and hit the *other* side of the barn. [These antennas](https://thepointsguy.com/wp-content/uploads/2015/10/antena.png
) cost a *lot* of money. There are [a few](http://aviationweek.com/site-files/aviationweek.com/files/imagecache/medium_img/uploads/2017/05/gogo2ku-install.jpg
) different [types](http://blog.wandr.me/wp-content/uploads/2014/07/IMG_8034_thumb.jpg
) but they all seem to use phased arrays to some extent, with the newest versions moving entirely to phased array. Phased arrays are a little complex to explain but they let you aim the beam electronically instead of by physically turning the antenna. Eventually the cellular antennas will also use phased arrays (cell phone towers already do, to a very limited extent).
Phased arrays are also the same kind of radar used in the biggest radar installations, early-warning missile launch systems. For instance Lt. Gen Trey Obering had this to say about [one such system](https://en.wikipedia.org/wiki/Sea-based_X-band_Radar
> The radar was described by Lt. Gen Trey Obering (former director of MDA) as being able to track an object the size of a baseball over San Francisco in California from Chesapeake Bay in Virginia, approximately 2,900 miles (4,700 km) away.