When you immerse an object under water, it pushes the water away in order to take its place.
The water wants to get back to where it was before and pushes the object away, towards the surface.
Then it depends what is the weight of the object, compared with how much water was moved.
Imagine you could put your object on one side of a balance, and on the other side, you would duplicate your object and transform it into water (representing how much water is moved if you were to plunge put your object under water).
If your original object is lighter than its equivalent in water, like a bubble for example, or a balloon, the water will be strong enough to have the object to float.
If the object is heavier than its equivalent water, like a bowling ball, or a rock, the water will not be able to push hard enough, and the object will sink.