How does shareware store its usage? Most shareware (free trial) allows only for limited use e.g. one week or 10 uses. This shareware must have a way of storing the times it was used or for how long you have been using this. 

Yet when I trash a shareware app, along with all it's preference files etc (using apptrap) and redownload it, it seems to remember the times used/usage time, even when I delete all of its pref files.

I am alarmed that an application is storing data that persists on my computer even after I deleted what I thought were all traces of the application. If it can store usage data even after I thought I deleted it, there's no limit to the other data about me this software could be storing. I realize that different applications might use different techniques, but a great answer could outline some of the most common mechanisms.

How does an app know how many times it has been used? Where does it store this so that it persists even after I delete the application's preference file?

(this is a question out of pure interest, I don't intend to use this info for malicious purposes)
OSX Applications come in a .bundle file which is basically like a ZIP or other archive file in that it's actually a sort of folder. In that way all of your program files and dependencies are in one, neat package. Sometimes, though, other information like preferences will be stored throughout the system. Typical places to look are /Library and /Users/(user)/Library. Warning - do NOT delete anything unless you really, really want to mess something important up. If you have a legitimate concern I would suggest contacting the developer and asking for assistance.