Both are in the passive voice, but the first is the simple past and the second is the present perfect.
The simple past is used to refer to something that happened in the past. Usually this past action has no relevance to the present; but if it does, then any relevance to the present is not important.
The present perfect is used to connect a past action with the present. This means that the action is in the past, but we're really talking about the present.
"They have been transferred to Anytown General Hospital" means that they are now in Anytown General Hospital -- if you want to find them, that's where you have to look.
"They were transferred to Anytown General Hospital" does not tell you where they are now. They might be at Anytown General, but then again they might not. They might have left hospital, or been transferred to a third hospital. They might even have died. Or it might have happened 100 years ago. We don't know.
Two dialogues to help you:
"So, what happened?"
"Well, then they were transferred to Anytown General."
"And where are they now?"
"They're recovering at home."
"I'm going to Anytown Royal Infirmary to visit Ted and Kate."
"Oh -- they're not there any more. They've been transferred to Anytown General."
"So where are they?"
"I told you -- Anytown General!"
"I mean, which ward are they on?"
"Oh -- ward 23."
No, that's the past perfect. It's used for an action in the more distant past -- one that might not affect the present, but did have some relevance in the past.
It's 9am. I arrive at Anytown Infirmary looking for Ted and Kate. The receptionist tells me: "They're not here. They've been transferred to the General Hospital." She uses the present perfect because the result of the action -- Ted and Kate are at the General -- is relevant now, at 9am.
Later. Now it's 5pm, and I'm telling you what happened. I say: "I went to the Infirmary this morning, but Ted and Kate had been transferred to the General." I use the past perfect because the result of the action is not relevant now -- at least, not for this conversation -- but it was relevant at 9am.
If I say, "I went to the infirmary this morning, but they were transferred", although both actions happened in the past, there's nothing to tell you which order the events happened in. Were Ted and Kate at the Infirmary when I went there? Were they transferred before my visit or after? The sentence doesn't make that clear.