In a solution of water, hydrogen can use one of its lone pairs to grab a hydrogen proton, allowing the oxygen to take its electrons and turn into a neutral character.
The carbon atom that forms the carbonyl group can let go of one of the bonds in the double bond, and the electrons in that bond can be used by the oxygen to capture a hydrogen proton.