When the number of applications is greater than available lots of shares (that is, when the IPO is oversubscribed), allotment is done through a lottery system conducted by the company. In such cases, you will be allotted shares only if your application is picked up in the lottery. While this is the most common reason for not getting an allotment, there are other reasons such as invalid application and bid price being lower than issue price.