It is perfectly possible, and hence there's no magic. Unfortunately, I have no information to make any inference on your eyesight, though.
Consider a <- c(1, 2), and b <- c(1, 2, 3).
Then, if you do all(a %in% b), it'll be TRUE, as a is a subset of b. But, if you do sum(b %in% a), that will be just 2, and not 3 because b is not a subset of a.
Hope this helps.