Mini PCs can range in price, from ultra-budget to serious AI workstations, but their components don't differ much from what you'd find in a laptop. Like a laptop, these machines aren't really designed to be upgraded. You aren't expected to be able to swap out a motherboard or replace the CPU. In fact, the CPU and GPU are often soldered onto the motherboard. Unless you're handy with a soldering iron, there's no real route forward to switch these out.
If your mini PC can be upgraded at all, it'll usually allow you to swap out the SSD or RAM. Mini PCs typically come with SO-DIMM memory modules, as well as smaller M.2 SSDs, both of which you'll also find in a modern laptop. It isn't always a given that these are components you can replace, though. You'll find mini PCs on sale that feature both soldered memory and storage that prevent any possibility of future upgrades.
By design, you've also got few options for expansion. The limited space inside a mini PC case means it's unlikely that you'll find extra RAM or SSD slots for upgrades. External I/O might be limited, too, with a smaller number of USB ports, for example.
Some mid-tier and better mini PCs come with OCuLink or Thunderbolt USB-C ports that allow you to connect an external GPU inside an enclosure. This won't allow you to upgrade your mini PC directly, but it can give you extra power for gaming or workstation AI requirements, with some loss of performance compared to a desktop PC.
You've also got a longevity issue. Cheap mini PCs aren't running with the most powerful components, so once they're too slow to use effectively, replacing it fully could be your only option.