When an object is immersed in a fluid it experiences an upward force. This upward force exerted on a body is known as buoyant force and this property is called buoyancy.
If an object’s weight is less than the buoyant force acting on it, then the object floats. If an object’s weight is greater than the buoyant force acting on it, then the object sinks.
A given volume of a denser substance is heavier than the same volume of a less dense substance. Therefore, density of an object also affects whether it sinks or floats.
The force due to the gravitational attraction of the earth acts on the bottle in the downward direction. So the bottle is pulled downwards. But the water exerts an upward force on the bottle. Thus, the bottle is pushed upwards. We have learnt that weight of an object is the force due to gravitational attraction of the earth. When the bottle is immersed, the upward force exerted by the water on the bottle is greater than its weight. Therefore it rises up when released.