Using joins to quickly cross compare tables?

I’m wonder if joins would help me do this fast

I have one table of id’s, and I want to count how many of those id’s match id’s in the second table.

Something like this perhaps?
SELECT COUNT(t1.uid) FROM users AS t1 INNER JOIN uid AS t2 ON t1.uid = t2.uid;