The Wilcoxon Rank sum test doesn't "subtract a random score of one group to a random score of another group".
If it did what you say in the question, that could work perfectly well with even very different sample sizes (since you could sample either with replacement so having the same sample size would be unnecessary), but that's not how it works.
As the name suggests, the rank-sum test sums the ranks in one of the samples. It may then apply a shift (say by subtracting the minimum possible sum of ranks).
[Where did you get the idea? It sounds like someone tried to explain permutation tests to you but they've ended up with a muddle of paired and independent sample and rank vs original-value notions all smooshed together.]
There's not one single alternative for the Wilcoxon Rank Sum test; it depends on what additional assumptions you make and how you look at it. The most general alternative form is that $P(X>Y)\neq \frac12$ (two tailed; the one tailed versions replace $\neq$ with either $<$ or $>$).