This is a wonderful question! To understand why things float you have to consider two things: 1) what is pushing "up" and 2) what is pushing "down"? The "down" force is easy - this is the boat being heavy that you mention in your question. So heavy boats are getting pushed into the water with a lot of force (by gravity)! So why don't they sink?
The "up" force: If you take a plastic ball and try to push it under water it can be quite hard because even if you can't see it, you are raising the level of the entire pool by a small amount. So you are actually pushing water up which is hard to do because water is also "heavy". So here is the answer to your question: boats float because when gravity tries to pull them into the water, it also has to push a lot of water up (the amount of water that has to move to let the boat in) so even though boats are heavy, they are also very big. If you had a boat that weighed the same as one that could float, but it was the size of a pebble it would clearly sink.
This idea that the size of the boat makes it less "heavy" in water is referred to as "density". Heavy boats float because they are less heavy than the amount of water they push away when they start to sink.
I hope this helps!
Answer 2 :
The nail sinks because the density of the steel is greater than the density of the water. But ocean liners are made of steel so why do they float, and since they do float, why do they sometimes also sink?
Everyone’s heard of gravity, that mysterious force that pulls everything downward, but did you know there is also an opposing force? Buoyancy is the push to gravity’s pull. Buoyancy is the force that floats your boat. To understand buoyant force, think about what happens when you put an ice cube into your glass of water.
As the ice cube displaces, or pushes away, some of the water it causes the level in the glass to rise and your ice cube to float partially in and partially out of the water like a miniature iceberg. Like a game of tug-of-war; gravity is pulling the ice cube down and buoyant force is pushing it up. How far in or out of the water your ice cube rests depends on its density, or solidness, because that is what the pushing and pulling forces are working against.
A Greek mathematician and inventor named Archimedes noticed that when he stepped into his bathtub the water level rose. He reasoned that the weight of the water he displaced was equal to the buoyant force in the water. This is called Archimedes Principle and it applies to all fluids.
Kids find it easy to remember Archimedes and his discovery when you ask them:
Do you remember the story about the guy who shouted “Eureka!” after leaving his bath naked?
You can learn more about Archimedes by visiting Learn From Zero With Me!’s Learn about Archimedes article.
But back to the question of the hour….Why does a boat float but a nail sink?
Ocean liners are made of steel and they float because their density is less than that of the water they float in. The ability of a boat to float depends on its average density. Average density takes into account not just the weight of the steel hull but also the air trapped in it. A ship with a large volume of trapped air has a lower density than that of the water it sits in – so it floats.
When a ships hold is full of cargo it floats lower in the water because there is less trapped air making it denser. Likewise a ship empty of cargo has more trapped air so it’s less dense and it floats higher out of the surrounding water. If the ship loses enough of its capacity to hold trapped air, it sinks. Remember the story about the Titanic?
A submarine is designed to have almost the same density of the ocean water that surrounds it. In order for a submarine to sink the crew pumps water into tanks called ballast tanks. To surface the submarine forces the water out of the ballast tanks and fills them with air, lessening the density of the sub and bringing it up to the surface.
Gravity, buoyancy and density work together to determine what floats your boat, or sinks your ship.