In case of elevators we have motor attached to pulley, which has counter weight on one side and elevator car on the other side. Now let us say if elevator car is of 100 kg and counter weight is of 150 kg-then why don't elevator car just shoots up, what is preventing this to happen?
The direct answer to your question would be: The Motor
The point of the counterweight is to reduce the overall force the motor has to apply to get the elevator moving and to stop it. The counterweight is designed to be approximately equal in weight to the elevator. So, when the elevator is stationary, the weights are balanced and the motor has to apply no force.
When the elevator is loaded with people, the effective weight the the motor has to move is only the difference between the elevator and counterweight. Whereas, if there were no counterweight, the motor would have to move the entire elevator plus the people, which would require a much greater force.