Based on your statement here:
There are more elements in B than in A.
What I think may be confusing you (and I may be wrong, of course) and what no one else has said yet is that your function doesn't need to hit every element of $B$.
And it is true that in order to be a function, one element in $A$ cannot go to more than one element of $B$.
However, it is allowed for more than one element of $A$ to go to one element of $B$. This does not violate the definition of being a function. In fact, it is precisely this scenario that gives you a function that is not one-to-one (because many elements in $A$ go to one element in $B$).
Regarding your question:
How do I know which element maps where?
It is entirely up to you, as long as your function actually is a function (i.e., it doesn't send one element of $A$ to more than one element of $B$). Here's a simple example, much like Arthur's: Define a function $f$ so that every element of $A$ gets sent to the element $1$ in $B$. Then, specifically, you have:
f(a) = 1, \qquad f(b) = 1, \qquad f(c) = 1, \qquad f(d) = 1
This is a perfectly valid function. And it is not one-to-one because different elements in $A$ go to the same element in $B$.