Is weight the main reason things float or sink?

I’ve heard that weight doesn’t always matter for floating. Can someone clarify?

Weight does play a role, but it’s really about the relationship between weight and displaced water.

Shawn said:
Weight does play a role, but it’s really about the relationship between weight and displaced water.

Exactly. It’s more about volume and density working together.

For example, a huge ship floats because its shape displaces enough water to balance its weight.