You're quite right. Tracks that are already in the iTunes database(?) do not count against your 25K. This includes tracks you bought in iTunes, at other music sites or ripped from a CD.
I'm not sure how likely it is that your average consumer will have more than 25,000 songs that iTunes doesn't know about.
And I'm not sure how they ever talked the record companies into it.
Matched tracks DO count towards your 25k limit. The only tracks which are excluded are those purchased from the iTunes Music store and whose iCloud status show purchased in your library.
----------
If you have higher quality files, does iTunes match or Cloud Player replace them with lower quality 256k files?
iTunes Match will not replace anything on your local library automatically. If you have add a lossless file locally you will keep that but the file send to iCloud will be 256k so if you play the same file from your iPad via iTunes Match it will be a 256k version.