Why does sand get firmer when it is wet?

Sand is made up of tiny grain particles that are largely oval or flat. When they get wet, the particles can more easily move around and align, which packs them more tightly together.