I have to assume that they don't know all of the editors personally, and that newer agents must have some type of a database to draw from. Does anyone know?
Actually, they overwhelmingly do know the editors personally. Knowing those editors personally is part of their job. And newer agents meet those editors through introductions from the older, more experienced agent(s) with whom they're working.
The vast majority of successful agents start out as assistants for successful agents. (In fact, I'm not aware of a single truly successful agent who became an agent by just hanging out a shingle, as it were, without any previous experience.)
Just having an editor's contact info isn't enough. An agent needs to know who that editor is, what s/he likes and doesn't like, what s/he is looking for and is sick of, what s/he just acquired and is desperate to acquire, what sorts of authorial voices or outlooks said editor is more likely to connect with... That's what agents are paid for (among other things).
If Editor A and Editor B are both at one imprint, and are both looking for genre X, the agent can't submit Manuscript Y to both. The agent has to choose one or the other, and that agent is going to choose the one most likely to love the book, and they can only do that by knowing the tastes of each editor.