It depends on the state. States around PA and NJ Have the actual prize amount in the code. Other states may as well, I just know for certain there. For example a $20 winner will have the letters like TWY in the code. My friend and I found a bunch in the trashcan and thought the same thing and asked the clerk about it. Customers who buy massive amounts of tickets and don't have the time or patience to scratch them just scratch the bottom to see if they won. That's why you often see such a big pile.
As for the clerks being able to scan the tickets, not possible. There is no way to discover whether the ticket is a winner until the bottom code is scratched off, which is to deter that exact situation.
For any scratch ticket you want to buy, look at the odds on the back of the ticket (or the website). And buy as many tickets as the odds. So if the odds are 1:348 you will increase your odds if you buy four tickets. If you buy double the odds, so in that example, eight tickets, you are almost sure to win. (Granted you could win $10 and have just spent $80, but it does increase your odds.) In order to increase your odds always buy all the tickets for the same game, from the same roll, don't jump around buying different tickets. If you do that you are potentially jumping around to buy all losing tickets. Always check the state website first to make sure the jackpot is still available. Buy the tickets with the maximum number of jackpots available, and also with the most number of tickets already sold, some states have that available on the website as well, but not all.
The odds favor the house, but there are a few tips to increase your odds.