How your website gets penalised??

I want to know why a website gets penalised??How to recover it if it gets penalised??
If you are trying to promote your website following Black Hat techniques, i.e. by breaching Google guidelines that your website will get penalized. There are two biggest Google update i.e. Penguin and Panda. If your website is getting penalized by Google Panda update, than it may be because you are using low quality content in the website. So you need to update high quality and fresh content.

Penguin update is more about penalizing website's having low quality backlinks. So in this case you need to focus more on getting quality backlink from niche sites and having the combination of both Dofollow and Nofollow links.
There could be a lot of reasons why your website was penalised. At present google rather penalise just a single page instead of all domain which is good. The most common reasons why your website can be penalised are bad backlinks (penguin) or violation with content (panda).