Difference between liability insurance and comprehensive car insurance?

When I hit another car and if I have liability insurance the insurance company is going to pay for the other guy's car repair if it is my fault. If it is the other guy's fault his car insurance company is going to pay me for repair. Then why do people take comprehensive car insurance?

If I hit a wall or tree then it may help, but it happens very rarely.