The limit is the transaction
Governor limits are counted per transaction, not per record. A trigger that runs one query per record does not use one query — it uses as many queries as the data load has rows, and the platform stops it at 101.
Counting the wrong thing
The instinct is to count records. The platform counts statements, and the difference is the entire lesson.
The fix is a pattern
Collect the ids first, query once, put the results in a map, then loop. It is three lines longer and it does not care whether the load is one record or two hundred.
Testing it honestly
A test that inserts one record proves nothing about the case that broke. Insert two hundred.