The Internal Revenue Code states that a non-dividend distribution from an S corporation to a shareholder is tax-free to the extent that it does not exceed the stockholder's stock basis. If the S corporation had income or experienced another taxable event (i.e. sale) during the year then you would likely be subject to income taxes.
As a S corporation shareholder it is very important to understand how to compute your stock basis. Your stock basis starts with your initial capital contribution and then is increased and/or decreased based on the flow-through amounts from the S corporation.
An income item will increase stock basis while a loss, deduction or distribution will decrease stock basis. Also keep in mind that each year you should be issued a K-1 to reflect the S corporation's income, loss and deductions which are allocated to you.
S corporation tax laws can get complicated so let us know if you have any additional questions.