Well, they can pull into port, but much of the time the supplies are brought to them and delivered by "replenishment at sea" - sometimes the supply ship and the receiving ship get beside each other and connect hoses and wires and pass pallets of material and gallons of fuel (including aircraft fuel) over 120 or so feet of ocean between them as them steam parallel at 12 knots or so (underway replenishment or "unrep"). Sometimes helicopters are used to tranfer things (vertical replenishment or "Vertrep"). When the transfer is complete, the receiving ship can continue its mission and the supply ship can head back for more supplies.
I once had a skipper who compared the big ships involved to the "dance of the baby elephants." In their book Keepers of the Sea Fred Maroon and Edward Beach wrote:
...[I]n no fleet maneuver is the steering ability of the helmsman, indeed, the exercise of pure seamanship by all hands so demanding. No evolution is so fraught with potential danger as the high-speed maneuvering of huge ships in close quarters, where the knowledge of one's ship, of the action of the wind and the sea, and of the laws of physics is crucial. At replenishment stations, some individuals seem to have an intuitive awareness of what is happening around them. Such men never seem to lose sight of the ponderously certain outcome of the events they have set in motion. They have eyes in the backs of their heads, a feel for the sea in the tips of their fingers, and the born confidence of a professional juggler or racing car driver. It shows in the way they handle their heavy gear and in the way they drive their ships.."There are not many higher honors (in my opinion) in the surface Navy than being selected as the underway replenishment officer of the deck, conning officer or as a member of the bridge team. It's a recognition of professional skill and that "feel" that a Commanding Officer bestows on a few, select individuals. (I served as unrep OOD on two different ships for 4 different captains, I note proudly).
All photos are from the U.S. Navy photo galleries here.