Underway replenishment (UNREP) is common method for transferring fuel, munitions, and stores from one ship to another while under way. A classic image is this one of a supply ship servicing the USS Oriskany (CVA-34) and another ship at one time:
Aircraft carriers can also provide replenishment on a limited basis to their escorts.
Sometimes the weather doesn’t cooperate, as shown here in some pictures I took from the flight deck of USS Oriskany while it was refueling the Waldron (DD-699).