There is something basic in our desire to classify things. Early humans no doubt looked around them at the natural world and instinctively began to group, and subgroup, things. Maybe they grouped things that flew, things that swam, things with leaves, or whatever. And, we have been doing it ever since, trying to create a taxonomy of the natural world that helps us to make sense of it.
Trouble is, our taxonomies are always a best guess, or an approximation, of nature, and this is very evident in the three major groups of rocks. Introductory geology students are usually taught about igneous, metamorphic, and sedimentary rocks, but this really is an oversimplification of nature.
Igneous rocks are those that form from a full melt, where the mineral material is completely turned to a liquid state. From a hot, liquid state, the mix is cooled at various rates and under various conditions to create a variety of igneous rocks. If the mixture cools underground, we call the liquid rock magma, and the rock that forms from it is called an intrusive igneous rock. If the liquid comes to the surface and cools faster, we call it lava, and the rock is an extrusive igneous rock.
Sedimentary rocks generally start with any of the already-formed rock types, and through weathering, transport, and re-deposition, lay down new rock combinations. For example, weathering of a rock may form sand-sized grains that get transported to a beach where it is later solidified into a rock called sandstone. There are other common sedimentary rocks like shale, siltstone, and limestone.
Metamorphic rocks are the hardest to understand in concept, I think. This process is similar to igneous in that it involves heat to cook the rock, but for metamorphic rocks the process does not progress to a full melt of liquid rock. Instead, the heat, and often high pressures of geologic processes, transforms the mineral and rock structure. This is common in mountain-building processes, where the intense pressure of tectonic plates colliding squeezes the rock with immense pressures.
Geologists name the layers of rock that we map to help unravel geologic history. There is a whole code for the naming of rock formations.
But this neat taxonomy of igneous, metamorphic, and sedimentary is not always clear-cut. Many rock types are really a combination of processes; we should not expect that nature falls into our simple categories. Take ash fall deposits for example. Ash is spewed from volcanoes during an eruption (an igneous process) and then blown across the landscape, often forming very thick deposits (a sedimentary process). There are several examples of ash like this across the Central Plains, far from where the ash originated. One prime example is at Ash Fall State Park in central Nebraska where a herd of rhinos was buried by a thick ash deposit.
Travertine is another rock that has a mixed origin. Water is heated at depth by proximity to magma (igneous) and picks up minerals. The water can then travel to the surface where it cools and deposits the minerals layer upon layer (sedimentary), building up travertine. This rock often has interesting texture and colors due to mineral impurities, making it a nice decorative stone used for tiles.
So, we start with basic guidelines as way to understand geologic processes. I have described this as “lying” to intro students, not maliciously, but by giving them principles that are true enough, but oversimplified. If you go on in geology you spend the rest of your education learning the exceptions to the rules.