The coin comparator is looking for metal content that matches the sample coin.
Mint(s) do a great job of ensuring that all of the state quarters, and whatever else is stamped on them conform to certain metal content, size and weight.
I am in Canada - $1 coin called is called a Loonie, due to the national bird (a loon) cast on one side. Our two dollar coin is called a Toonie. It is made of two different metals.
During one circulation run the center metal was replaced with a phosphorous version that glowed in the dark. The metal properties remained consistent.
One joke that went around is that bi-metallic elements give off small amounts of electricity - so it is suggested that if you are wearing a pace maker you should never carry more than $730 in your breast pocket.
We retired our $1, $2 paper money about 10 years ago and the penny has been abandoned about 3 years ago. In cash transactions we round up or down for the benny, but credit/debit transactions remain accurate. There is discussion about changing our $5.00 bill to a coin as well but I have not heard much about that as of late. Our other paper money all have see through sections printed on polymer with holographic images embedded in the see through areas.
Coming back to the comparator's - I use Tokens in mine and not real money. The metal content varies quite a bit, and with the exception of one particular series of token I am able to adjust any rejection.
On occasion the sample coin has dead on me. I think it becomes magnetized or de-magnetized (or something ??) and I have to replace it with a new token.
I have a casino toke box screwed on at the end of my bar. I dump in the dead coins and (worthless) novelty chips that I occasionally pick up. Just a decoration.
There also third party options for coin comparitors. Typically 1 coin (regardless of coin) = 1 credit. The momnix (??spelling) which is a non powered plastic validator that measures size and weight - doesn't use a sample coin. I bought one S+ that had this. I pitched it.
There are also programmable coin comparitors that allow you to use a variety of coins. You program it by putting in various coins and telling it what you want it to do. Ie You could have a penny machine but when you insert a quarter it gives 25credits. Or if its a quarter machine it takes 25 pennies before it gives a credit. You can also program that 1 quarter = 1 credit, but 3 quarters = 4 credits. On the flip side of this your coin hopper won't like this very much at all and assuming it doesn't jam would have no ability to know if its paying out 10 quarters or a mixture of 10 random coins.