Magma forms when solid rock deep in Earth’s crust or mantle melts, while sediment forms when existing rocks at the surface are broken down, moved, and dropped off by water, wind, ice, or gravity.

Magma: rock that melted

Think of magma as underground molten rock that forms where it gets hot enough, or the rock’s melting point drops.

  • Deep inside Earth, temperature increases with depth; if rocks get hot enough, their minerals start to melt and form magma.
  • Adding water (like at subduction zones where an ocean plate sinks) can lower the melting point of mantle rocks, helping magma form without needing extreme extra heat.
  • Reducing pressure (for example, when rock rises toward the surface at mid‑ocean ridges or hotspots) can also cause solid rock to partially melt and become magma; this is called decompression melting.
  • The exact composition of magma depends on the rock that melted and how much of it melted, which is why some magmas are runny (basaltic) and others are thicker (andesitic or rhyolitic).

In short: heat, pressure changes, and water are the big controls on where and how magma forms inside Earth.

Sediment: broken pieces of rock

Sediment is any loose material like sand, mud, gravel, and dissolved ions that comes from breaking down older rocks.

  • Weathering is the first step:
    • Physical weathering cracks and breaks rocks into smaller pieces by freezing and thawing, plant roots, temperature changes, or abrasion.
    • Chemical weathering changes minerals into new ones (like clays) or dissolves them; rainwater and weak acids are key players.
  • Erosion and transport move these particles away from where they formed:
    • Water in rivers and streams is the main mover, but wind, glaciers, and gravity also play big roles.
* Smaller and lighter particles can be carried farther and stay suspended longer; larger ones drop out sooner when the current weakens.
  • Deposition happens when the transporting force loses energy, so sediment settles to the bottom of rivers, lakes, oceans, floodplains, dunes, and deltas.

Over long timescales, layers of deposited sediment can be compacted and cemented together to become sedimentary rock.

How magma and sediment connect

Magma and sediment are two different stages in the rock cycle, but they are linked.

  • When magma cools and crystallizes, it forms igneous rock. That rock can later be uplifted to the surface and weathered into sediment.
  • Sediment can be buried and turned into sedimentary rock; if that rock is pushed deep enough, heated and maybe partially melted, it can contribute to new magma.

So, magma mostly forms from melting deep rock , and sediment mostly forms from breaking and moving surface rock —two ends of the same ongoing rock cycle.

Information gathered from public forums or data available on the internet and portrayed here.