Selecting entries with the same count as in another table
If I understand your requirement correctly, You can try something like this.

This will get count per ID from table1 and table2 and then return only those records where T1.ID count matches the second table

SELECT T1.ID FROM
(
    SELECT ID,Count(*) c 
    From Table1 GROUP BY ID
) T1
INNER JOIN 
(
     SELECT ID,Count(*) c 
     From Table2 GROUP BY ID
) T2
ON T1.ID = T2.ID AND T1.c = T2.c