Not specific to wordpress, but any relational database architecture. Basically you have a table with content and a table with tags. Then to bridge the two you have a table that associates one to the other.
Here's a link to a more in depth description:
http://www.anchor.com.au/hosting/support/CreatingAQuickMySQLRelationalDatabase
So you have a content table with a primary key id.
You also have a tags table with its own primary key id.
Your relational table has both of those ids simply like so...
----------------------------
| id | content_id | tag_id |
----------------------------
You can then use joins of many varieties to select content based on tags and so on.
This subject is WAY too in depth for stack overflow though. It is suggested you do some basic google searches for mysql database structures, relational tables, and joins. The list could go on for days.
Any specific questions? I may update if you ask.