Prefixes are keys or units of language in the English vocabulary that can no longer be divided. They tend to have different meanings which can be identified thru context and common sense. Like in our example, prefixes in and ex mean inside and outside respectively.
Technically speaking, an intrusion is consists of intrusive igneous rock formed from magma within or inside the crust of the planet. On the other hand, an extrusion is a formation of extrusive rock formed above or outside the surface of the crust. So just remember in for inside and ex for outside to remember the difference between intrusion and extrusion.