I'm sure you know very well that light things float on water and that heavy things sink, so it doesn't surprise you that wooden things float, while stones or metal objects sink. There are actually some heavy types of wood that sink and some fluffy kinds of rock which float (because they contain a lot of air), but you rarely come across them. The big surprise, though, is that metal ships weighing thousands of tons float. How can this be?
The ship will of course only float so long as it's filled with air. If you measure the amount of space that the ship takes up, including the air inside it, and then work out the weight of water that would take up the same amount of space, that amount of water would also weigh thousands of tons, and indeed it would actually weigh many thousands of tons more than the ship, so it turns out that even though the ship is extremely heavy, it is much lighter than the water it's floating on. However, as soon as you fill the ship with water, the ship plus all the water inside will weigh more than the water that would take up the same amount of space on its own (without the metal), and so the ship will sink. Incidentally, a wooden ship filled with water may float just under the surface (with a few bits just sticking out) rather than sinking: this can happen because the wood may be slightly lighter than the amount of water that would take up the same space as the wood. The important thing to note is that wooden ships and metal ships both float high in the water when they are filled with air, and both sink down into the water when you fill them with water, so it doesn't make a lot of difference whether a block of the material they are made of floats or sinks: ships float because the air inside them makes the boat as a whole lighter than the water it is sitting on.
That's all very well, but how does the water under the ship know that the ship has air in it rather than water? How does it know whether it should hold the ship up or move out of the way to let it sink? The answer is pressure, so let me just remind you what pressure is. The pressure gets stronger as you go deeper underwater, and it gets weaker as you come back up. Pressure also weakens as you climb up a mountain, and if you could climb all the way up into space, the pressure would be so low that there would be no pressure at all. Pressure is caused by the weight of all the gas or water higher up: all this material presses down on the material below, but the material below is rather like a spring and so it presses back upwards with equal force. The more air or water there is over your head, the higher the pressure will be, and the amount of pressure is directly related to the weight of all that material which is pressing down on you. When material is under pressure, it also presses out sideways in all directions, so it doesn't only push upwards and downwards: this is because it's trying to move in any direction where the pressure might be lower. The only place the pressure is usually any lower is higher up, but the material can't flow upwards because gravity is pulling it back down at the same time, so molecules and atoms in air and water just press against each other all the time, and they do so more strongly the deeper down they find themselves. So, pressure is just material pushing against all the material around it and all the material around it pushing back, and ultimately it's all caused by gravity trying to pull everything downwards (ignoring situations like the inside of a tyre where lots of air has been pumped in it to give it a higher pressure than it would normally have).
Now that we know what pressure is, we can begin to think about the pressure under the ship where the sea water and metal hull of the ship are pushing against each other. If the ship is full of air, the hull will press down against the water with a strength that comes from the weight of the ship and the air inside it (plus the weight of the air over the ship all the way up to the edge of space). The ship will float at the height where this downward pressure is matched by the upward pressure coming from the water underneath, and these two pressures will be equal when the ship has made a dent in the sea exactly big enough to push its own weight of water out of the way. If the ship then tried to sink any lower in the water, the pressure of the water underneath its hull would get stronger because it would be deeper down in the sea, but the downward pressure from the hull of the ship would stay the same: the result would be that the water underneath would win the fight, pushing the ship back up again to where the pressures are equal again. In the same way, if the ship tried to float higher in the water, the pressure of the water under its hull would get weaker because it would be nearer the surface, but the ship would continue to press down with the same strength as before, so the water would be unable to hold the ship up: it would sink back down to the point where the pressures are equal. So if you think about it, a metal ship full of air DOES sink, but it only sinks down into the water until the underside of its hull is sitting on water at a high enough pressure to stop it sinking any further.
If you fill the ship with water, the hull of the ship will press down with a lot more force, because it's now being pushed down hard by all the extra weight of water inside it. This means it will sink lower and lower in the sea as the ship fills up. When the ship is completely full of water, the hull presses down with more force than the water underneath can possibly push back with, no matter how deep the ship goes. So, the ship will disappear completely under the surface, and continue to sink. As it descends towards the seabed, the upward pressure of the water under its hull will keep getting stronger, but so will the downward pressure from the hull because there is now water over the top of the ship as well, and this extra water is pushing down against the ship with more and more force as the ship sinks deeper: the ship will continue to press down more strongly than the water below it can ever push upwards, and therefore it can't stop sinking until it hits the sea floor.
That's almost the whole story, but there's one extra bit which should complete the story for you, though it's much harder to understand. Can the pressure upwards from the water really match the pressure downwards from the ship at every point on the hull when the boat's sitting at a constant height, perhaps in harbour? Not all parts of the hull are as deep in the water as others, so it's hard to believe that the weight on each piece of hull can be exactly right wherever it happens to be, but nevertheless the pressures upwards from the water and downwards from the hull do indeed match at all points: this happens because pressure differences that fail to make the ship to rise or fall will cause slight bending of the hull instead, and that bending adjusts the downwards pressure until it matches the upwards pressure from the water. Imagine a section of the hull which is held lower in the water than it might ideally be: it may not seem that it can press down against the water hard enough to stay down, but the shape of the hull and weight of the whole ship force it to remain where it is, so the extra upwards pressure from the water will push up against it hard and distort it a fraction, thereby transferring downward force from elsewhere on the hull to where it's needed through tension in the metal. In the same way, a part of the hull that's higher up than it might ideally be will bulge down very slightly until it isn't pressing down against the water any harder than the water's pushing up, some of the downward pressure being removed by other parts of the hull pulling it back up through tension in the metal. It's easy to imagine panels of metal bending, but the frame of the ship is much stronger and won't bend in quite the same way, but even so, atoms can still be pressed in more tightly such that they get pushed back out more strongly by other atoms, so there is still a kind of bending going on through stresses in the material, but it manifests itself as changes of pressure within the metal itself from one region to another.