"Ratio of wooden bats to metal bats is 2 to 1" basically means "there are twice as many wooden bats (compared to metal ones)". So if we had 3 metal bats, then we'd have 2*3 = 6 wooden bats. If we had 7 metal bats, then we have 14 wooden ones (because 2*7 = 14). And so on. The basic rule is to multiply the amount of metal bats by 2 to get the amount of wooden ones.
We can go in reverse to divide the amount of wooden bats to get the amount of metal ones. So 20/2 = 10 is the amount of metal bats.
------------------
A more formal approach is to use the proportion below to solve for x
20/x = 2/1
20*1 = x*2
20 = 2x
2x = 20
2x/2 = 20/2
x = 10
and we get the same answer.