Q:

How does wordpress protect theme source code? 

If I buy a theme from a website, can I read the source code from it? 
If I can, how can I protect the source code? 

A:

You can view any of the theme's source code either from the Appearance>Editor menu in the Admin control panel of Wordpress, or by downloading the theme to your local machine via FTP, and just opening up the files in a text editor. 
Now your question about protecting the source code of the theme.  Who are you trying to protect it from?  The source code is only visible from the admin side of Wordpress (which you need a username/password to get into) or via an FTP client connecting to your web server (which also would need a login account to do). 
If your concerned about random website visitor seeing the php code for the site's theme, you needn't worry.  Random website visitor won't have access to the php files that control your site's theme. 
//Edited to add more info//
If someone buys your theme, and downloads the .zip of it in order to upload it to their own web server, there's virtually nothing you can do to prevent someone from seeing the .php code that runs the theme.  
There might be some methods of encrypting code, and then having some 3rd party service decrypt the code before the web server runs it, but you'll be looking at some huge performance losses with something like that.  
You would be better off building a solid theme with features people want, and would be willing to pay for, while maintaining good communication with your customers, and pushing bug fixes/updates in a very timely manner.