It's a dangerous process-but a necessary one. The refueling of jet planes around the globe are constantly looking to improve the technology behind air-to-air refueling. For the United States Armed Forces, there are two different methods used for this specific process: one more primarily used by the US Navy, and the other by the US Air Force (though this is changing).
The US Navy Method
The method employed by Navy pilots is called probe-and-drogue refueling:
Attached to the receiving craft is a retractable probe that filters in jet fuel via a long, flexible hose that is attached at the other end to a massive tanker. At the end of the hose, a "basket" tails behind the tanker to allow for more space between the two aircraft-the jet flies up, properly aligns its probe with the basket, and gently eases it into place. This method is considered favorable in terms of its increased safety for the pilots involved, yet the process is still closely monitored and carefully executed-it is completely dependent upon the skill of the pilot to initiate refueling. The basket itself can cause thousands of dollars in damage with just a passing blow.
The US Air Force Method
The method commonly employed by Air Force pilots is a quite a ways different and is referred to as flying boom refueling.
The tanker is equipped with a "telescoping" boom handle, rigid and articulated. This piece of equipment is carefully controlled by a boom operator. The receiving aircraft has a receptacle that receives the boom and locks in, initiating fueling. What can be dangerous in this process is that the boom operator ends up having to make the final move by inserting the boom and locking in. The hand-flown fighter jet just needs to remain as still as possible (not capable of initiating a comfortable autopilot like the tanker).
Why the two different methods?
The boom method was invented way back during the Cold War-Strategic Air Command had huge fleets of bombers that required air-to-air refueling and they needed a transfer system that worked as quickly as possible. Compared to the probe-and-drogue method, the boom method is actually faster: due to the straight arm of the boom, the fuel is quickly exchanged between the two vehicles:
Because the boom is rigid, it is capable of a higher transfer rate. The importance of bombers meant that SAC got their way, and the KC-135 fleet was equipped with booms. Today, almost all US Air Force planes capable of aerial refueling use the boom system. —user from aviation.stackexchange.com
Contrarily, the US Navy's probe-and-drogue system is more popular worldwide. In addition to not needing an operator for the hose (which simply comes to a standstill due to the steady flight of the tanker and a heavy metal basket), the drogue system is very simple and is more easily achieved by the jet pilot, though not excessively so. Furthermore, the high-transfer rates of the boom arm is not needed on smaller aircraft that can't even handle such high rates of flow.
In the early 2000s, the Air Force renewed their tanker fleet and optioned for both methods of air-to-air refueling via the KC-46.